|
|
@@ -71,9 +71,30 @@ class AuthService
|
|
|
public function loginByAccount($account, $password = '', $isAutoLogin = 0)
|
|
|
{
|
|
|
$user = $this->checkUser($account, $password, 2);
|
|
|
- if (!$user) {
|
|
|
+ if (!$user && $password == '') {
|
|
|
+ //20251020增加验证登录直接注册功能
|
|
|
+ $data = [
|
|
|
+ 'mobile' => $account,
|
|
|
+ 'password' => Hash::make($this->getRandomName()),
|
|
|
+ 'utype' => 1,
|
|
|
+ 'reg_type' => 1,
|
|
|
+ 'reg_source' => 2,
|
|
|
+ 'member_status' => 1,
|
|
|
+ 'reg_source_cn' => '接码自动注册',
|
|
|
+ 'mobile_audit' => 1,
|
|
|
+ 'username' => $this->getRandomName(),
|
|
|
+ 'reg_time' => time(),
|
|
|
+ 'last_login_time' => time(),
|
|
|
+ 'reg_ip' => ip2long(request()->ip()),
|
|
|
+
|
|
|
+ ];
|
|
|
+ $member = $this->memberRepository->create($data);
|
|
|
+ $user = $this->checkUser($account, $password, 2);
|
|
|
+ }else{
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// if(!$this->checkPwdLog($user)){
|
|
|
// return false;
|
|
|
// }
|
|
|
@@ -361,4 +382,9 @@ class AuthService
|
|
|
Auth::guard('web-organization')->logout();
|
|
|
}
|
|
|
|
|
|
+ private function getRandomName()
|
|
|
+ {
|
|
|
+ //str_replace(substr($data['mobile'], 3, 4), "****", $data['mobile']);
|
|
|
+ return uniqid();
|
|
|
+ }
|
|
|
}
|