修复登录报错问题
This commit is contained in:
@@ -21,7 +21,7 @@ class PasswordLoginController extends BaseController
|
||||
* @param int $typeId
|
||||
* @return UserModel
|
||||
*/
|
||||
protected function getUserProfileWithAccountAndType(string $account, int $typeId): UserModel
|
||||
protected function getUserProfileWithAccountAndType(string $account, int $typeId)
|
||||
{
|
||||
$user = UserModel::where(
|
||||
function ($query) use ($account) {
|
||||
@@ -34,7 +34,11 @@ class PasswordLoginController extends BaseController
|
||||
}
|
||||
)->find();
|
||||
|
||||
return $user;
|
||||
if(!empty($user)){
|
||||
return $user;
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +52,6 @@ class PasswordLoginController extends BaseController
|
||||
protected function getUser(string $account, string $password, int $typeId): array
|
||||
{
|
||||
$user = $this->getUserProfileWithAccountAndType($account, $typeId);
|
||||
|
||||
if (!$user) {
|
||||
throw new \Exception('用户不存在或已禁用', 403);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user