|
@@ -24,7 +24,8 @@ const state = {
|
|
|
authUserId: userInfo?.authUserId || '',
|
|
|
userIdentity: userInfo?.userIdentity || '',
|
|
|
proxyInfo: null,
|
|
|
- shopType: userInfo?.shopType || ''
|
|
|
+ shopType: userInfo?.shopType || '',
|
|
|
+ brandId: userInfo?.brandId || ''
|
|
|
}
|
|
|
|
|
|
const mutations = {
|
|
@@ -42,6 +43,7 @@ const mutations = {
|
|
|
state.authUserId = userInfo.authUserId
|
|
|
state.userIdentity = userInfo.userIdentity
|
|
|
state.shopType = userInfo.shopType
|
|
|
+ state.brandId = userInfo.brandId
|
|
|
},
|
|
|
SET_PROXY_INFO: (state, proxyInfo) => {
|
|
|
state.proxyInfo = proxyInfo
|
|
@@ -57,10 +59,10 @@ const actions = {
|
|
|
const { username, password } = userInfo
|
|
|
return new Promise((resolve, reject) => {
|
|
|
login({ mobileOrName: username.trim(), password: password }).then(response => {
|
|
|
- const { shopStatus, token, authUserId, userIdentity, name, shopType } = response.data
|
|
|
+ const { shopStatus, token, authUserId, userIdentity, name, shopType, brandId } = response.data
|
|
|
const roles = formatRoles(userIdentity)
|
|
|
commit('SET_TOKEN', token) // 保存token
|
|
|
- commit('SET_USERINFO', { shopStatus, authUserId, userIdentity, shopType }) // 保存用户信息
|
|
|
+ commit('SET_USERINFO', { shopStatus, authUserId, userIdentity, shopType, brandId }) // 保存用户信息
|
|
|
commit('SET_ROLES', roles) // 根据用户类型生成角色列表
|
|
|
commit('SET_NAME', name) // 保存用户名称
|
|
|
// commit('app/SET_IS_REFRESH', false)
|