Initial commit: queue workspace
Made-with: Cursor
This commit is contained in:
52
pro_v3.5.1/app/validate/api/user/RegisterValidates.php
Normal file
52
pro_v3.5.1/app/validate/api/user/RegisterValidates.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\api\user;
|
||||
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 注册验证
|
||||
* Class RegisterValidates
|
||||
* @package app\http\validates\api\user
|
||||
*/
|
||||
class RegisterValidates extends Validate
|
||||
{
|
||||
protected $regex = ['phone' => '/^1[3456789]\d{9}$/'];
|
||||
|
||||
protected $rule = [
|
||||
'phone' => 'require|regex:phone',
|
||||
'account' => 'require|regex:phone',
|
||||
'password' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'phone.require' => '手机号必须填写',
|
||||
'phone.regex' => '手机号格式错误',
|
||||
'account.require' => '手机号必须填写',
|
||||
'account.regex' => '手机号格式错误',
|
||||
'captcha.require' => '验证码必须填写',
|
||||
'captcha.length' => '验证码长度不正确',
|
||||
'password.require' => '密码必须填写',
|
||||
];
|
||||
|
||||
|
||||
public function sceneCode()
|
||||
{
|
||||
return $this->only(['phone']);
|
||||
}
|
||||
|
||||
|
||||
public function sceneRegister()
|
||||
{
|
||||
return $this->only(['account', 'captcha', 'password']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user