chore: pre publish

This commit is contained in:
xiaojunnuo
2023-05-25 13:43:32 +08:00
parent 420b835b09
commit 998200e570
7 changed files with 22 additions and 12 deletions
@@ -1,9 +1,5 @@
import { Config, Provide } from '@midwayjs/decorator';
import {
IWebMiddleware,
IMidwayKoaContext,
NextFunction
} from '@midwayjs/koa';
import { IWebMiddleware, IMidwayKoaContext, NextFunction } from '@midwayjs/koa';
import * as _ from 'lodash';
import * as jwt from 'jsonwebtoken';
import { Constants } from '../basic/constants';
@@ -21,7 +17,8 @@ export class AuthorityMiddleware implements IWebMiddleware {
resolve() {
return async (ctx: IMidwayKoaContext, next: NextFunction) => {
const { url } = ctx;
const token = ctx.get('Authorization');
let token = ctx.get('Authorization') || '';
token = token.replace('Bearer ', '').trim();
// 路由地址为 admin前缀的 需要权限校验
// console.log('ctx', ctx);
const queryIndex = url.indexOf('?');