first commit
This commit is contained in:
40
application/common/validate/Auth.php
Normal file
40
application/common/validate/Auth.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\common\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 用户授权部分验证
|
||||
*/
|
||||
class Auth extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
* @var array
|
||||
*/
|
||||
protected $rule = [
|
||||
'title' => 'require|min:3|max:32|unique:auth',
|
||||
'remark' => 'length:0,255',
|
||||
'status' => 'in:0,1',
|
||||
];
|
||||
|
||||
/**
|
||||
* 错误提示消息
|
||||
* @var array
|
||||
*/
|
||||
protected $message = [
|
||||
'title.require' => '分组名称必须填写',
|
||||
'title.min' => '分组名称不应少于:rule字符',
|
||||
'title.max' => '分组名称不应大于:rule字符',
|
||||
'title.unique' => '分组名称已经存在',
|
||||
'remark.length' => '备注信息请保持在:1-:2字符之间',
|
||||
'status.in' => '不合法的分组状态',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user