chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | YwxApp [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: ywxapp<admin@ywxapp.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\member\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* Register 类
|
||||
*
|
||||
* @author ywxapp <admin@ywxapp.cn>
|
||||
*/
|
||||
class Register extends Validate
|
||||
{
|
||||
/**
|
||||
* 注册表单校验规则(与前端 register/index.html 字段一致)
|
||||
* 字段:cellphone 手机号 / vercode 短信验证码 / password / repass 确认密码 / nickname 昵称 / agreement 协议
|
||||
*/
|
||||
protected $rule = [
|
||||
'cellphone' => 'require|regex:/^1[3-9]\d{9}$/',
|
||||
'vercode' => 'require|length:4,6',
|
||||
'password' => 'require|length:6,20',
|
||||
'repass' => 'require|confirm:password',
|
||||
'nickname' => 'require|length:2,20',
|
||||
'agreement' => 'accepted',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'cellphone.require' => '请输入手机号',
|
||||
'cellphone.regex' => '手机号格式不正确',
|
||||
'vercode.require' => '请输入短信验证码',
|
||||
'password.require' => '请输入密码',
|
||||
'password.length' => '密码长度需在 6-20 位',
|
||||
'repass.confirm' => '两次输入的密码不一致',
|
||||
'nickname.require' => '请输入昵称',
|
||||
'nickname.chsDash' => '昵称只能包含中文、字母、数字及 _-',
|
||||
'agreement.accepted' => '请先同意用户协议',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user