Bläddra i källkod

feat:新增获取白名单api

yangfeng 10 månader sedan
förälder
incheckning
80ac3f7d1d
2 ändrade filer med 31 tillägg och 11 borttagningar
  1. 8 6
      apps/mobile/src/api/modules/public.js
  2. 23 5
      apps/mobile/src/store/modules/user.js

+ 8 - 6
apps/mobile/src/api/modules/public.js

@@ -67,8 +67,6 @@ export function ajaxSetNewUserADRead(data) {
 
 /**
  * 获取最新标讯,用于首页展示
- * @param data
- * @returns {*}
  */
 export function ajaxGetIndexList(data) {
   return request({
@@ -80,8 +78,6 @@ export function ajaxGetIndexList(data) {
 
 /**
  * 获取参标状态
- * @param data
- * @returns {*}
  */
 export function ajaxCanBiaoStatus(data) {
   return request({
@@ -94,13 +90,11 @@ export function ajaxCanBiaoStatus(data) {
 
 /**
  * 参标--终止参标
- * @param data
  * action:
  *  in:参标-当前用户参标
  *  out:终止参标-1、员工终止当前自己对此项目参标的状态;2:部门管理员终止当前部门下对此项目参标的状态;3:企业管理员终止当前企业下对此项目的参标状态
  *  transfer:划转-1、部门管理员当前部门下参标此项目的对象;2、企业管理员企业下~~~~
  *  参标|终止参标:bidIds和projectIds 必传一个
- * @returns {*}
  */
 export function ajaxCanBiaoAction(action, data) {
   return request({
@@ -331,3 +325,11 @@ export function getZhiMaFilterData() {
     method: 'get'
   })
 }
+
+// 是否是白名单用户
+export function getIsWhiteList() {
+  return request({
+    url: '/publicapply/userbase/whitelist',
+    method: 'get'
+  })
+}

+ 23 - 5
apps/mobile/src/store/modules/user.js

@@ -9,7 +9,8 @@ import {
   getMySelectEntInfo,
   getUserIdentity,
   changeUserIdentity,
-  getMineCompany
+  getMineCompany,
+  getIsWhiteList
 } from '@/api/modules'
 
 export default {
@@ -80,7 +81,9 @@ export default {
     // 用户当前身份
     userCurrentIdentity: null,
     // 用户所属公司信息
-    userCompanyInfo: null
+    userCompanyInfo: null,
+    // 白名单用户
+    whiteListStatus: false
   }),
   mutations: {
     changeVipSwitch(state, data) {
@@ -117,6 +120,9 @@ export default {
     // 用户所属公司信息
     updateCompanyInfo(state, data) {
       state.userCompanyInfo = data
+    },
+    updateIsWhiteList(state, data) {
+      state.whiteListStatus = data
     }
   },
   actions: {
@@ -146,9 +152,8 @@ export default {
     },
     async userVipSwitchState({ commit }, payload) {
       try {
-        const { error_code: code, data = {} } = await userVipSwitchState(
-          payload
-        )
+        const { error_code: code, data = {} } =
+          await userVipSwitchState(payload)
         if (code === 0) {
           commit('changeVipSwitch', data.vt)
         }
@@ -234,6 +239,15 @@ export default {
           return data
         }
       } catch (error) {}
+    },
+    async getWhiteListInfo({ commit }) {
+      try {
+        const { error_code: code, data = {} } = await getIsWhiteList()
+        if (code === 0) {
+          commit('updateIsWhiteList', data?.onTheWhitelist)
+          return data
+        }
+      } catch (error) {}
     }
   },
   getters: {
@@ -413,6 +427,10 @@ export default {
     // 用户公司信息
     userCompanyInfo(state) {
       return state.userCompanyInfo || {}
+    },
+    // 是否是白名单用户
+    isWhiteList(state) {
+      return state.whiteListStatus || false
     }
   }
 }