【代码评审】Bpm:模型列表的优化

This commit is contained in:
YunaiV
2025-01-23 19:40:49 +08:00
parent bf437421bb
commit 58455cd0a4
3 changed files with 17 additions and 18 deletions

View File

@ -15,8 +15,7 @@ interface UserVO {
interface UserInfoVO {
// USER 缓存
permissions: string[]
permissionsSet: Set<string>
permissions: Set<string>
roles: string[]
isSetUser: boolean
user: UserVO
@ -24,8 +23,7 @@ interface UserInfoVO {
export const useUserStore = defineStore('admin-user', {
state: (): UserInfoVO => ({
permissions: [],
permissionsSet: new Set<string>(),
permissions: new Set<string>(),
roles: [],
isSetUser: false,
user: {
@ -36,7 +34,7 @@ export const useUserStore = defineStore('admin-user', {
}
}),
getters: {
getPermissions(): string[] {
getPermissions(): Set<string> {
return this.permissions
},
getRoles(): string[] {
@ -59,8 +57,7 @@ export const useUserStore = defineStore('admin-user', {
if (!userInfo) {
userInfo = await getInfo()
}
this.permissions = userInfo.permissions
this.permissionsSet = new Set(userInfo.permissions)
this.permissions = new Set(userInfo.permissions)
this.roles = userInfo.roles
this.user = userInfo.user
this.isSetUser = true
@ -88,7 +85,7 @@ export const useUserStore = defineStore('admin-user', {
this.resetState()
},
resetState() {
this.permissions = []
this.permissions = new Set<string>()
this.roles = []
this.isSetUser = false
this.user = {