init
- 框架初始化 - 安装插件 - 修复PHP8.4报错
This commit is contained in:
28
addons/shopro/validate/third/Wechat.php
Normal file
28
addons/shopro/validate/third/Wechat.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace addons\shopro\validate\third;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Wechat extends Validate
|
||||
{
|
||||
|
||||
protected $regex = [
|
||||
'mobile' => '/^1[3456789]\d{9}$/',
|
||||
];
|
||||
|
||||
protected $rule = [
|
||||
'mobile' => 'require|regex:mobile|unique:user'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'mobile.require' => '手机号必须填写',
|
||||
'mobile.regex' => '手机号格式不正确',
|
||||
'mobile.unique' => '手机号已被占用',
|
||||
];
|
||||
|
||||
|
||||
protected $scene = [
|
||||
'bindWechatMiniProgramMobile' => ['mobile']
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user