This commit is contained in:
2026-03-05 16:34:25 +08:00
parent 13ee9e66cc
commit 69e199e9cc
15 changed files with 1398 additions and 677 deletions

View File

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