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;
|
||||
|
||||
// 如果是超级管理员或者管理员,则返回 true
|
||||
if (userRole === 'admin') return;
|
||||
if (userRole === 'admin') return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -38,7 +38,7 @@ export class RolesGuard implements CanActivate {
|
||||
context.getClass(),
|
||||
]);
|
||||
|
||||
if (isPublic) return;
|
||||
if (isPublic) return true;
|
||||
|
||||
const role = this.reflector.get<string>('role', context.getHandler());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user