Mike hace 4 años
padre
commit
f1104d7f67
Se han modificado 2 ficheros con 9 adiciones y 8 borrados
  1. 3 2
      app/Helpers/functions.php
  2. 6 6
      app/Models/User.php

+ 3 - 2
app/Helpers/functions.php

xqd
@@ -35,8 +35,9 @@ if (!function_exists('exit_out')) {
         }
 
         $json = json_encode($out, JSON_UNESCAPED_UNICODE);
-
-        throw new ExitOutException($json);
+        echo $json;
+        die();
+        //throw new ExitOutException($json);
     }
 }
 

+ 6 - 6
app/Models/User.php

xqd xqd xqd
@@ -42,7 +42,7 @@ class User extends BaseModel
             if (!$is_exit) {
                 return [];
             }
-            out(null, 401, '验证失效,请重新登录');
+            exit_out(null, 401, '验证失效,请重新登录');
         }
 
         $arr = aes_decrypt($auth);
@@ -55,12 +55,12 @@ class User extends BaseModel
         if (isset($arr['doctor_id'])){
             // 说明是医生登陆!
             if (empty($arr['doctor_id'])) {
-                out(null, 401, '医生验证失效,请重新登录');
+                exit_out(null, 401, '医生验证失效,请重新登录');
             }
 
             $user = Docter::where('id', $arr['doctor_id'])->first();
             if (empty($user)){
-                out(null, 601, '该账号已被删除');
+                exit_out(null, 601, '该账号已被删除');
             }
             $user = $user->toArray();
 //            if ($user['status'] == 0){
@@ -71,17 +71,17 @@ class User extends BaseModel
 
         }else{
             if (empty($arr['id'])) {
-                out(null, 401, '账号验证失效,请重新登录');
+                exit_out(null, 401, '账号验证失效,请重新登录');
             }
 
             $user = User::where('id', $arr['id'])->first();
             if (empty($user)){
-                out(null, 601, '该账号已被删除');
+                exit_out(null, 601, '该账号已被删除');
             }
             $user = $user->toArray();
 
             if ($user['status'] == 0){
-                out(null, 602, '该账号已被冻结');
+                exit_out(null, 602, '该账号已被冻结');
             }
 
             return $user;