You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
619 B
PHP

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace app\admin\validate;
use think\Validate;
class Admin extends Validate
{
protected $rule=[
'name'=>'unique:admin|require|max:25',
'password'=>'require|min:6',
];
protected $message=[
'name.require'=>'管理员名称不得为空!',
'name.unique'=>'管理员名称不得重复!',
'password.require'=>'管理员密码不得为空!',
'password.min'=>'密码不得少于6位',
];
protected $scene=[
'add'=>['name','password'],
'edit'=>['name','password'=>'min:6'],
];
}