mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-01-08 12:58:19 +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)) {
|
if (_.startsWith(url, adminUrl)) {
|
||||||
try {
|
try {
|
||||||
ctx.admin = jwt.verify(token, this.coolConfig.jwt.secret);
|
ctx.admin = jwt.verify(token, this.coolConfig.jwt.secret);
|
||||||
|
// 超管拥有所有权限
|
||||||
|
if(ctx.admin.username == 'admin' && !ctx.admin.isRefresh){
|
||||||
|
await next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
// 不需要登录 无需权限校验
|
// 不需要登录 无需权限校验
|
||||||
if (new RegExp(`^${adminUrl}?.*/open/`).test(url)) {
|
if (new RegExp(`^${adminUrl}?.*/open/`).test(url)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user