|
|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
}
|