Skip to content

Commit 4eaf2dc

Browse files
committed
feat: gpt mermaid markmap
1 parent 69d7fc9 commit 4eaf2dc

File tree

4 files changed

+873
-390
lines changed

4 files changed

+873
-390
lines changed

src/components/auth/PermissionGuard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ const PermissionGuard: React.FC<PermissionGuardProps> = ({
6969
const checkPermission = async () => {
7070
try {
7171
setIsLoading(true)
72-
let result = false
72+
// 默认通过:按需叠加权限/角色限制
73+
let result = true
7374

7475
// 检查权限
7576
if (permission) {
@@ -84,7 +85,7 @@ const PermissionGuard: React.FC<PermissionGuardProps> = ({
8485
}
8586
}
8687

87-
// 检查角色(如果权限检查通过,才检查角色
88+
// 检查角色(若已有权限限制则需先通过权限;若无权限限制则直接检查角色
8889
if (result && role) {
8990
result = await permissionService.hasRole(role)
9091
} else if (result && roles && roles.length > 0) {

0 commit comments

Comments
 (0)