重构
This commit is contained in:
@ -24,11 +24,12 @@ const user = {
|
||||
token: getToken(),
|
||||
id: storage.get(constant.id),
|
||||
name: storage.get(constant.name),
|
||||
avatar: storage.get(constant.avatar),
|
||||
roles: storage.get(constant.roles),
|
||||
permissions: storage.get(constant.permissions),
|
||||
belongSite: storage.get(constant.belongSite)
|
||||
},
|
||||
avatar: storage.get(constant.avatar),
|
||||
roles: storage.get(constant.roles),
|
||||
permissions: storage.get(constant.permissions),
|
||||
belongSite: storage.get(constant.belongSite),
|
||||
currentSiteId: storage.get(constant.currentSiteId)
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_TOKEN: (state, token) => {
|
||||
@ -54,11 +55,15 @@ const user = {
|
||||
state.permissions = permissions
|
||||
storage.set(constant.permissions, permissions)
|
||||
},
|
||||
SET_BELONGSITE: (state, belongSite = []) => {
|
||||
state.belongSite = belongSite || []
|
||||
storage.set(constant.belongSite, belongSite || [])
|
||||
}
|
||||
},
|
||||
SET_BELONGSITE: (state, belongSite = []) => {
|
||||
state.belongSite = belongSite || []
|
||||
storage.set(constant.belongSite, belongSite || [])
|
||||
},
|
||||
SET_CURRENTSITEID: (state, currentSiteId = '') => {
|
||||
state.currentSiteId = currentSiteId || ''
|
||||
storage.set(constant.currentSiteId, currentSiteId || '')
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
@ -133,4 +138,4 @@ const user = {
|
||||
}
|
||||
}
|
||||
|
||||
export default user
|
||||
export default user
|
||||
|
||||
Reference in New Issue
Block a user