Parcourir la source

feat: 新增 userType 额外参数传递

zhangyuhan il y a 1 an
Parent
commit
6cdb016545

+ 1 - 1
apps/bigmember_pc/src/views/search/bidding/model/index.js

@@ -181,7 +181,7 @@ function getParams(params = {}) {
       reqType: 'lastNews',
       pageNum: listState.pageNum,
       pageSize: listState.pageSize,
-      // 额外用户身份 vType
+      // 该接口与用户身份有关
       _expand: {
         type: userType.value
       }

+ 7 - 1
apps/bigmember_pc/src/views/search/purchase/model/index.js

@@ -1,6 +1,7 @@
 import { computed, reactive, ref } from 'vue'
 import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
 import { filterState } from './modules/filter'
+import { useStore } from '@/store'
 
 // 解构基础业务
 const APIModel = useQuickSearchModel({
@@ -77,11 +78,16 @@ function doChangeFilter() {
   doQuery()
 }
 
+// 获取 store getters
+const userType = computed(() => {
+  return useStore().getters['user/userType']
+})
+
 function getParams() {
   return {
     // 该接口与用户身份有关
     _expand: {
-      type: 'eType'
+      type: userType.value
     },
     searchType: 'title',
     keywords: inputKeywordsState.value.input,