This commit is contained in:
xiaojunnuo
2025-01-15 22:58:11 +08:00
parent 6877b865a7
commit 87620b9072
13 changed files with 130 additions and 68 deletions
@@ -88,8 +88,7 @@ export class AuthorityMiddleware implements IWebMiddleware {
async doOpenHandler(ctx: IMidwayKoaContext, next: Next) {
//开放接口
let openKey = ctx.get('Authorization') || '';
openKey = openKey.replace('Bearer ', '').trim();
const openKey = ctx.get('x-api-token') || '';
if (!openKey) {
ctx.status = 401;
ctx.body = Constants.res.auth;