Browse Source

状态返回值修改为业务状态码

master
wanghongjun 3 days ago
parent
commit
7036a56c7c
  1. 4
      app/Http/Controllers/Admin/AuthController.php

4
app/Http/Controllers/Admin/AuthController.php

@ -62,11 +62,11 @@ class AuthController extends Controller
$user = AdminUsers::where('username', $request->username)->first();
if (!$user || !Hash::check($request->password, $user->password)) {
throw new CustomException(__('validation.auth.u_p_error'), 401);
throw new CustomException(__('validation.auth.u_p_error'), 400);
}
if ($user->status !== 1) {
throw new CustomException(__('validation.auth.u_disabled'), 403);
throw new CustomException(__('validation.auth.u_disabled'), 400);
}
// 删除旧token

Loading…
Cancel
Save