|
@@ -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
|
|
|
}
|
|
|
}
|
|
|
}
|