Browse Source

fix: 短信去掉前面0

master
liyang 1 week ago
parent
commit
597ac79c9c
  1. 15
      app/home/service/LoginService.php

15
app/home/service/LoginService.php

@ -66,7 +66,6 @@ class LoginService extends BaseHomeService
// 返回结果 // 返回结果
return $this->toData('0', lang('email_send_successfully')); return $this->toData('0', lang('email_send_successfully'));
} catch (ValidateException $validateException) { } catch (ValidateException $validateException) {
// 参数校验失败 异常类 // 参数校验失败 异常类
$message = $validateException->getError(); $message = $validateException->getError();
@ -75,7 +74,6 @@ class LoginService extends BaseHomeService
// 异常情况 // 异常情况
return $this->toData('500', lang('system_busy'), [$exception->getMessage()]); return $this->toData('500', lang('system_busy'), [$exception->getMessage()]);
} }
} }
/** /**
@ -314,7 +312,8 @@ class LoginService extends BaseHomeService
} }
// 用户登陆之后需要进行的操作 异步完成 // 用户登陆之后需要进行的操作 异步完成
Queue::push('app\home\job\LoginDone', ['userId' => $userId, Queue::push('app\home\job\LoginDone', [
'userId' => $userId,
'fields' => [ 'fields' => [
'last_login_time' => date('Y-m-d H:i:s'), 'last_login_time' => date('Y-m-d H:i:s'),
'ip' => $this->getClientRealIp(), 'ip' => $this->getClientRealIp(),
@ -367,6 +366,8 @@ class LoginService extends BaseHomeService
$param['nation'] = trim($param['nation']); $param['nation'] = trim($param['nation']);
$param['phone'] = trim($param['phone']); $param['phone'] = trim($param['phone']);
//去掉前面0
$param['phone'] = ltrim($param['phone'], '0');
// 去除国内手机号 // 去除国内手机号
if ($this->checkForbidNation($param['nation'])) { if ($this->checkForbidNation($param['nation'])) {
return $this->toData('500', lang('unsupported_country_or_region')); return $this->toData('500', lang('unsupported_country_or_region'));
@ -680,7 +681,8 @@ class LoginService extends BaseHomeService
} }
// 用户登陆之后需要进行的操作 异步完成 // 用户登陆之后需要进行的操作 异步完成
Queue::push('app\home\job\LoginDone', ['userId' => $userId, Queue::push('app\home\job\LoginDone', [
'userId' => $userId,
'fields' => [ 'fields' => [
'last_login_time' => date('Y-m-d H:i:s'), 'last_login_time' => date('Y-m-d H:i:s'),
'ip' => $this->getClientRealIp(), 'ip' => $this->getClientRealIp(),
@ -834,7 +836,8 @@ class LoginService extends BaseHomeService
} }
// 用户登陆之后需要进行的操作 异步完成 // 用户登陆之后需要进行的操作 异步完成
Queue::push('app\home\job\LoginDone', ['userId' => $userId, Queue::push('app\home\job\LoginDone', [
'userId' => $userId,
'fields' => [ 'fields' => [
'last_login_time' => date('Y-m-d H:i:s'), 'last_login_time' => date('Y-m-d H:i:s'),
'ip' => $this->getClientRealIp(), 'ip' => $this->getClientRealIp(),
@ -933,7 +936,6 @@ class LoginService extends BaseHomeService
} catch (\Exception $exception) { } catch (\Exception $exception) {
return $this->toData('500', lang('system_busy')); return $this->toData('500', lang('system_busy'));
} }
} }
public function testLogin($param): array public function testLogin($param): array
{ {
@ -977,7 +979,6 @@ class LoginService extends BaseHomeService
} catch (\Exception $exception) { } catch (\Exception $exception) {
return $this->toData('500', lang('system_busy'), []); return $this->toData('500', lang('system_busy'), []);
} }
} }
public function getIP(): array public function getIP(): array
{ {

Loading…
Cancel
Save