Commit 6d1f9aca by lujunyi

药店登录

parent fd428f13
...@@ -55,16 +55,15 @@ public function postLogin(Request $request) ...@@ -55,16 +55,15 @@ public function postLogin(Request $request)
return $this->validationErrorsResponse($validator); return $this->validationErrorsResponse($validator);
} }
$user = AdminUsers::where(['username' => $credentials['username']])->first(); $user = AdminUsers::with('roles')->where(['username' => $credentials['username']])->first();
if (isset($user->is_block) && $user->is_block) { if (isset($user->is_block) && $user->is_block) {
return $this->validationErrorsResponse([ return $this->validationErrorsResponse([
$this->username() => '账号异常,请联系管理员!', $this->username() => '账号异常,请联系管理员!',
]); ]);
} }
// 检查用户角色是否为 pharmacy // 检查用户角色是否为 pharmacy
// if ($role === 'store' && $user && $user->role === 'pharmacy') { $isPharmacy = $user->roles->pluck('slug')->contains('pharmacy');
if ($role === 'store') { if ($role === 'store' && $user && $isPharmacy) {
// 验证短信验证码 // 验证短信验证码
$verificationCode = $request->input('verification_code'); $verificationCode = $request->input('verification_code');
// 假设您有一个方法来验证短信验证码 // 假设您有一个方法来验证短信验证码
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment