fix: BUG
This commit is contained in:
parent
56f70c5337
commit
d8de82efca
@ -21,7 +21,7 @@ const matchRole: (role: string, userRole: string) => boolean = (
|
|||||||
if (!role) return true;
|
if (!role) return true;
|
||||||
|
|
||||||
// 如果是超级管理员或者管理员,则返回 true
|
// 如果是超级管理员或者管理员,则返回 true
|
||||||
if (userRole === 'admin') return;
|
if (userRole === 'admin') return true;
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ export class RolesGuard implements CanActivate {
|
|||||||
context.getHandler(),
|
context.getHandler(),
|
||||||
context.getClass(),
|
context.getClass(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (isPublic) return;
|
if (isPublic) return true;
|
||||||
|
|
||||||
const role = this.reflector.get<string>('role', context.getHandler());
|
const role = this.reflector.get<string>('role', context.getHandler());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user