1.修改电话号码格式为60前缀,马来西亚格式

2.优化渠道可以查看分红方式,可以查看游玩详情
This commit is contained in:
2026-05-30 11:09:54 +08:00
parent 28d0100d5a
commit e65c3474bd
37 changed files with 1772 additions and 113 deletions

View File

@@ -5,6 +5,7 @@ namespace app\api\controller;
use ba\Date;
use ba\Captcha;
use ba\Random;
use app\common\library\MalaysiaMobilePhone;
use app\common\library\finance\WithdrawFlow;
use app\common\model\User;
use app\common\facade\Token;
@@ -235,7 +236,7 @@ class Account extends Frontend
return $this->error(__('Email') . ' ' . __('already exists'));
}
} else {
Validator::make($params, ['mobile' => 'required|regex:/^1[3-9]\d{9}$/'])->validate();
Validator::make($params, ['mobile' => 'required|regex:' . MalaysiaMobilePhone::PATTERN])->validate();
if (User::where('mobile', $params['mobile'])->find()) {
return $this->error(__('Mobile') . ' ' . __('already exists'));
}

View File

@@ -6,6 +6,7 @@ namespace app\api\controller;
use app\common\facade\Token;
use app\common\library\Auth as UserAuth;
use app\common\library\MalaysiaMobilePhone;
use app\common\model\User;
use app\common\service\MobileAuthDeviceService;
use ba\Random;
@@ -38,7 +39,7 @@ class Auth extends MobileBase
if ($inviteCode === '') {
return $this->mobileError(1001, 'Invite code required');
}
if (!preg_match('/^1[3-9]\d{9}$/', $username)) {
if (!MalaysiaMobilePhone::isValid($username)) {
return $this->mobileError(1003, 'Please enter the correct mobile number');
}

View File

@@ -2,6 +2,7 @@
namespace app\api\controller;
use app\common\library\MalaysiaMobilePhone;
use ba\Captcha;
use ba\ClickCaptcha;
use app\common\controller\Frontend;
@@ -138,7 +139,7 @@ class User extends Frontend
'password' => 'required|string|regex:/^(?!.*[&<>"\'\n\r]).{6,32}$/',
'registerType' => 'required|in:email,mobile',
'email' => 'required_if:registerType,email|email|unique:user,email',
'mobile' => 'required_if:registerType,mobile|regex:/^1[3-9]\d{9}$/|unique:user,mobile',
'mobile' => 'required_if:registerType,mobile|regex:' . MalaysiaMobilePhone::PATTERN . '|unique:user,mobile',
'captcha' => 'required|string',
'invite_code' => 'nullable|string|max:64',
],

View File

@@ -30,7 +30,7 @@ return [
'Invite code not bound to channel' => 'This invite code is not bound to a valid channel',
'Channel disabled' => 'Channel is disabled',
'Account already registered' => 'This phone number is already registered. Please sign in.',
'Please enter the correct mobile number' => 'Please enter the correct mobile number',
'Please enter the correct mobile number' => 'Please enter a valid Malaysia mobile number starting with 60',
'Registered successfully but login failed' => 'Registered successfully but login failed',
'Incorrect account or password' => 'Incorrect account or password',
'Login status has expired' => 'Login status has expired',

View File

@@ -62,7 +62,7 @@ return [
'Invite code not bound to channel' => '该邀请码未绑定有效渠道',
'Channel disabled' => '渠道已关闭',
'Account already registered' => '该手机号已注册,请直接登录',
'Please enter the correct mobile number' => '请输入正确的手机号',
'Please enter the correct mobile number' => '请输入正确的马来西亚手机号60开头',
'Registered successfully but login failed' => '注册成功但登录失败',
'Incorrect account or password' => '账号或密码错误',
'Login status has expired' => '登录状态已过期',