初始版本
This commit is contained in:
47
server/app/coachapi/validate/RegisterValidate.php
Executable file
47
server/app/coachapi/validate/RegisterValidate.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\coachapi\validate;
|
||||
|
||||
|
||||
use app\common\model\coach\CoachUser;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
/**
|
||||
* 注册验证器
|
||||
* Class RegisterValidate
|
||||
* @package app\api\validate
|
||||
*/
|
||||
class RegisterValidate extends BaseValidate
|
||||
{
|
||||
protected $rule = [
|
||||
// 'channel' => 'require',
|
||||
'account' => 'require|alphaNum|length:3,12|unique:' . CoachUser::class,
|
||||
'password' => 'require|length:6,20|alphaNum',
|
||||
// 'password_confirm' => 'require|confirm'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'channel.require' => '注册来源参数缺失',
|
||||
'account.require' => '请输入账号',
|
||||
'account.alphaNum' => '账号须为字母数字组合',
|
||||
'account.length' => '账号须为3-12位之间',
|
||||
'account.unique' => '账号已存在',
|
||||
'password.require' => '请输入密码',
|
||||
'password.length' => '密码须在6-20位之间',
|
||||
'password.alphaNum' => '密码须为字母数字组合',
|
||||
// 'password_confirm.require' => '请确认密码',
|
||||
// 'password_confirm.confirm' => '两次输入的密码不一致'
|
||||
];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user