fix: make SUPER_ADMIN role checks case-insensitive across app

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-27 17:04:22 +08:00
parent ad8bb5a75d
commit a0993767fe
11 changed files with 32 additions and 19 deletions

View File

@ -114,6 +114,10 @@ export const useUserStore = defineStore('user', () => {
// 判断当前用户是否拥有某个权限(菜单或元素)
const hasPermission = (code: string) => {
// 超级管理员拥有所有权限
if (role.value && role.value.toUpperCase() === 'SUPER_ADMIN') {
return true
}
return permissions.value.includes(code)
}