You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.4 KiB
40 lines
1.4 KiB
<?php
|
|
|
|
namespace app\admin\validate;
|
|
|
|
class AdminValidate extends AdminBaseValidate
|
|
{
|
|
|
|
protected $rule = [
|
|
'user_name' => 'require|alphaNum',
|
|
'password' => 'require|length:5,40',
|
|
'new_password' => 'require|length:5,40',
|
|
'old_password' => 'require|length:5,40',
|
|
'nick_name' => 'require|alphaNum',
|
|
'parent_id' => 'require|integer',
|
|
];
|
|
|
|
protected $message = [
|
|
'user_name.alphaNum' => '用户名只能包含字母和数字',
|
|
'nick_name.alphaNum' => '昵称只能包含字母和数字',
|
|
'password.require' => '请填写密码',
|
|
// 'password.isString' => '密码格式不正确.',
|
|
'password.length' => '密码必须大于5个字符.',
|
|
'new_password.require' => '请填写新密码',
|
|
// 'password.isString' => '密码格式不正确.',
|
|
'new_password.length' => '密码必须大于5个字符.',
|
|
'old_password.require' => '请填写原始密码',
|
|
// 'password.isString' => '密码格式不正确.',
|
|
'old_password.length' => '密码必须大于5个字符.',
|
|
|
|
];
|
|
|
|
|
|
protected $scene = [
|
|
'addUser' => ['user_name','password','nick_name','parent_id'],
|
|
'updateInfo' => ['nick_name','email'],
|
|
'updateAccount' => ['user_name','nick_name'],
|
|
'updatePassword'=>['new_password','old_password'],
|
|
'updateAccountStatus'=>['id','status']
|
|
];
|
|
}
|