mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-02-18 10:13:49 +00:00
字典接口权限
This commit is contained in:
parent
9f49777b90
commit
61d8c9d3c7
@ -33,7 +33,7 @@ export class BaseAuthorityMiddleware
|
|||||||
const token = ctx.get('Authorization');
|
const token = ctx.get('Authorization');
|
||||||
const adminUrl = '/admin/';
|
const adminUrl = '/admin/';
|
||||||
//忽略token验证的url
|
//忽略token验证的url
|
||||||
const ignoreUrls = ['/admin/dict/info/data'];
|
const ignoreUrls = [];
|
||||||
// 路由地址为 admin前缀的 需要权限校验
|
// 路由地址为 admin前缀的 需要权限校验
|
||||||
if (_.startsWith(url, adminUrl)) {
|
if (_.startsWith(url, adminUrl)) {
|
||||||
try {
|
try {
|
||||||
@ -66,7 +66,11 @@ export class BaseAuthorityMiddleware
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 要登录每个人都有权限的接口
|
// 要登录每个人都有权限的接口
|
||||||
if (new RegExp(`^${adminUrl}?.*/comm/`).test(url)) {
|
if (
|
||||||
|
new RegExp(`^${adminUrl}?.*/comm/`).test(url) ||
|
||||||
|
// 字典接口
|
||||||
|
url == '/admin/dict/info/data'
|
||||||
|
) {
|
||||||
await next();
|
await next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user