12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\common\validate;
- use think\Validate;
- class UserVali extends Validate
- {
- protected $regex = ['zip'=>'^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,16}$'];
- protected $rule = [
- 'phone' => 'require',
- 'email' => 'require|email',
- 'password' => 'require|regex:zip',
- ];
- protected $message = [
- 'phone.require' => '手机号必填',
- 'email.email' => '必须是邮箱',
- 'password.require' => '密码必填',
- 'password.regex' => '6-16位数字字母组合',
- ];
- protected $scene=[
- 'reset_password'=>['phone','password'],
- 'phone_login'=>['phone'],
- 'email_login'=>['email'],
- ];
- }
|