优化部分代码,增加微信公众号模板

This commit is contained in:
李琦
2026-08-13 19:01:21 +08:00
parent 21f39eed85
commit 2f5e298d6b
10 changed files with 83 additions and 41 deletions

View File

@@ -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('账号已被占用!');
}