2021-11-15 23:51:08 +08:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
|
|
|
* @license https://opensource.org/licenses/GPL-2.0
|
|
|
|
* @link https://www.gougucms.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace app\home\validate;
|
|
|
|
|
|
|
|
use think\Validate;
|
|
|
|
|
|
|
|
class RuleCheck extends Validate
|
|
|
|
{
|
|
|
|
protected $rule = [
|
2022-02-11 13:23:31 +08:00
|
|
|
'title' => 'require',
|
2021-11-23 17:04:53 +08:00
|
|
|
'name' => 'require',
|
2022-02-11 13:23:31 +08:00
|
|
|
'menu' => 'require',
|
2021-11-15 23:51:08 +08:00
|
|
|
'src' => 'unique:admin_rule',
|
|
|
|
'id' => 'require',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $message = [
|
2022-02-11 13:23:31 +08:00
|
|
|
'title.require' => '菜单节点名称不能为空',
|
|
|
|
'src.unique' => '同样的菜单节点URL已经存在',
|
|
|
|
'menu.require' => '是否是左侧菜单需要选择',
|
2021-11-23 17:04:53 +08:00
|
|
|
'name.require' => '节点日志操作名称不能为空',
|
2022-02-11 13:23:31 +08:00
|
|
|
'id.require' => '缺少更新条件'
|
2021-11-15 23:51:08 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
protected $scene = [
|
2022-02-11 13:23:31 +08:00
|
|
|
'add' => ['title','src','name','menu'],
|
|
|
|
'edit' => ['id', 'title','src','name','menu']
|
2021-11-15 23:51:08 +08:00
|
|
|
];
|
|
|
|
}
|