优化登录逻辑

This commit is contained in:
liweisen 2020-01-06 17:57:33 +08:00
parent bc6d90e546
commit 8e11bdcf59

View File

@ -84,6 +84,8 @@ class Login extends BasicApi
// }
$member = Member::where(['mobile' => $mobile])->order('id asc')->find();
} else {
!$data['password'] && $this->error('登录密码不能为空!');
!$data['account'] && $this->error('登录账号不能为空!');
$member = Member::where(['account' => $data['account']])->whereOr(['email' => $data['account']])->order('id asc')->find();
}
empty($member) && $this->error('账号或密码错误', 201);