Browse Source

移除公共的枚举调用

max 7 tháng trước cách đây
mục cha
commit
3493da6750
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      src/modules/api/middleware/authority.ts

+ 2 - 4
src/modules/api/middleware/authority.ts

@@ -1,7 +1,5 @@
 import { App, Config, Inject, Middleware } from '@midwayjs/decorator';
-import * as _ from 'lodash';
-import { CoolUrlTagData, RESCODE, TagTypes } from '@cool-midway/core';
-import * as jwt from 'jsonwebtoken';
+import { CoolUrlTagData,  } from '@cool-midway/core';
 import { NextFunction, Context } from '@midwayjs/koa';
 import {
   IMiddleware,
@@ -64,7 +62,7 @@ export class BaseAuthorityMiddleware
         if (sign !== vaSign) {
           ctx.status = 401;
           ctx.body = {
-            code: RESCODE.AUTHFAIL,
+            code: ctx.status,
             message: '签名不匹配,认证失败',
           };
           return;