Procházet zdrojové kódy

change: 移除对用户的身份认证验证

max před 7 měsíci
rodič
revize
c87ea70545
1 změnil soubory, kde provedl 11 přidání a 17 odebrání
  1. 11 17
      src/modules/api/middleware/authority.ts

+ 11 - 17
src/modules/api/middleware/authority.ts

@@ -70,7 +70,8 @@ export class BaseAuthorityMiddleware
       // let merchantCustomer = ''
 
       // 商户不存在或者说商户被禁用都提示失败
-      if (!merchantInfo || merchantInfo.status != 1 || !vaKey || !customer || customer.status !== 'ACTIVE') {
+      // if (!merchantInfo || merchantInfo.status != 1 || !vaKey || !customer || customer.status !== 'ACTIVE') {
+      if (!merchantInfo || merchantInfo.status != 1 || !vaKey || !customer) {
         let message = '';
         if (!vaKey) {
           message = 'API Secret 不存在!';
@@ -84,11 +85,8 @@ export class BaseAuthorityMiddleware
         if (!customer && !message) {
           message = '当前商户暂无认证';
         }
-        if (!customer && !message) {
-          message = '当前商户暂无认证';
-        }
 
-        if (customer?.status === 'PENDDING' && !message) {
+        /*if (customer?.status === 'PENDDING' && !message) {
           message = '当前商户认证还在审核中';
         }
 
@@ -101,20 +99,16 @@ export class BaseAuthorityMiddleware
         }
         if (customer?.status === 'CLOSED' && !message) {
           message = '当前商户认证资格被回收';
+        }*/
+        if(message) {
+          ctx.status = 401;
+          ctx.body = {
+            code: ctx.status,
+            message: message,
+          };
+          return;
         }
-
-        if (!message) {
-          message = '签名不匹配,认证失败';
-        }
-
-        ctx.status = 401;
-        ctx.body = {
-          code: ctx.status,
-          message: message,
-        };
-        return;
       }
-
       // 2. 生成签名
       const sign = this.generateSignature(
         `${vaTimestamp}`,