yingzi 2 anni fa
parent
commit
30e8076292
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 2 1
      app/api/controller/User.php
  2. 5 5
      app/api/middleware/UserMiddleware.php

+ 2 - 1
app/api/controller/User.php

@@ -155,7 +155,8 @@ class User extends BaseController
         unset($data["admin_mono"]);
         unset($data["admin_time"]);
         
-        
+        $typeData = (new TypeAudit)->where("uid",$request->user["uid"])->order("id","desc")->find();
+        $data["type_audit_status"] = 
         
         
         

+ 5 - 5
app/api/middleware/UserMiddleware.php

@@ -34,24 +34,24 @@ class UserMiddleware implements MiddlewareInterface
      */
     private function checkUser($token) {
         if(empty($token)) {
-            throw new AuthException('用户登录凭证错误', -1);
+            throw new AuthException('用户登录凭证错误', 410000);
         }
         try{
             $memData = (new UserModel)
                 ->where('token',$token)
                 ->find();
             if(empty($memData)) {
-                throw new AuthException('用户不存在', -1);
+                throw new AuthException('用户不存在', 410000);
             }
             if($memData['status']==0) {
-                throw new AuthException('用户审核中', -1);
+                throw new AuthException('用户审核中', 410000);
             }
             if($memData['status']==-1) {
-                throw new AuthException('用户已被禁用', -1);
+                throw new AuthException('用户已被禁用', 410000);
             }
             return $memData->toArray();
         }catch (\Throwable $e) {
-            throw new AuthException('系统错误,请重新登录', -1);
+            throw new AuthException('系统错误,请重新登录', 410000);
         }
     }
 }