优化部分代码,增加微信公众号模板
This commit is contained in:
@@ -30,7 +30,8 @@ class LoginService extends BaseNotAuthService
|
||||
$ua = UserAgentService::getInstance();
|
||||
$equipment = $ua->parseEquipment();
|
||||
$browser = $ua->parseBrowser();
|
||||
$userModel = AdminModel::with(['role:id,name,value'])->where('phone', $phone)->first();
|
||||
// 必须排除软删账号(deleted_at=0),否则被删管理员仍能用原密码登录
|
||||
$userModel = AdminModel::with(['role:id,name,value'])->where('phone', $phone)->where('deleted_at', 0)->first();
|
||||
if (empty($userModel)) {
|
||||
$this->writeLoginLog(0, (string) $phone, '', 1, '用户或密码错误', $equipment, $browser);
|
||||
UtilsService::getInstance()->errorThrow('用户或密码错误!');
|
||||
@@ -111,7 +112,7 @@ class LoginService extends BaseNotAuthService
|
||||
*/
|
||||
public function register($phone, $password, $email, $code): array
|
||||
{
|
||||
$userModel = AdminModel::where('phone', $phone)->first();
|
||||
$userModel = AdminModel::where('phone', $phone)->where('deleted_at', 0)->first();
|
||||
if ($userModel) {
|
||||
UtilsService::getInstance()->errorThrow('账号已被占用!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user