Skip to content

Commit 9c21797

Browse files
committed
fix:userInfo.permissions 兜底是空情况的处理
1 parent 1ee658f commit 9c21797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store/modules/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const useUserStore = defineStore('admin-user', {
6262
userInfo = await getInfo()
6363
} catch (error) {}
6464
}
65-
this.permissions = new Set(userInfo.permissions)
65+
this.permissions = new Set(userInfo.permissions || []) // 兜底为 [] https://t.zsxq.com/xCJew
6666
this.roles = userInfo.roles
6767
this.user = userInfo.user
6868
this.isSetUser = true

0 commit comments

Comments
 (0)