mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-29 05:10:17 +00:00
admin用户无需校验其他权限
This commit is contained in:
parent
e53ae0c211
commit
1f2d38a294
@ -34,6 +34,11 @@ export class BaseAuthorityMiddleware implements IWebMiddleware {
|
||||
if (_.startsWith(url, adminUrl)) {
|
||||
try {
|
||||
ctx.admin = jwt.verify(token, this.coolConfig.jwt.secret);
|
||||
// 超管拥有所有权限
|
||||
if(ctx.admin.username == 'admin' && !ctx.admin.isRefresh){
|
||||
await next();
|
||||
return;
|
||||
}
|
||||
} catch (err) {}
|
||||
// 不需要登录 无需权限校验
|
||||
if (new RegExp(`^${adminUrl}?.*/open/`).test(url)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user