2021-01-30 20:59:12 +08:00
|
|
|
<?php
|
2021-07-26 17:41:59 +08:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2021 勾股工作室
|
2021-11-24 17:17:29 +08:00
|
|
|
* @license https://opensource.org/licenses/Apache-2.0
|
2021-07-26 17:41:59 +08:00
|
|
|
* @link https://www.gougucms.com
|
|
|
|
*/
|
|
|
|
|
2021-01-30 20:59:12 +08:00
|
|
|
namespace app\admin\validate;
|
|
|
|
|
|
|
|
use think\Validate;
|
|
|
|
|
|
|
|
class RuleCheck extends Validate
|
|
|
|
{
|
|
|
|
protected $rule = [
|
2022-02-21 12:47:48 +08:00
|
|
|
'title' => 'require',
|
2021-01-30 20:59:12 +08:00
|
|
|
'src' => 'unique:admin_rule',
|
|
|
|
'id' => 'require',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $message = [
|
|
|
|
'title.require' => '节点名称不能为空',
|
2022-02-21 12:47:48 +08:00
|
|
|
'src.unique' => '同样的节点URL已经存在',
|
2021-01-30 20:59:12 +08:00
|
|
|
'id.require' => '缺少更新条件',
|
|
|
|
'filed.require' => '缺少要更新的字段名',
|
|
|
|
];
|
|
|
|
|
|
|
|
protected $scene = [
|
2021-08-31 23:40:54 +08:00
|
|
|
'add' => ['title','src'],
|
|
|
|
'edit_title' => ['id', 'title'],
|
|
|
|
'edit_src' => ['id', 'src'],
|
2021-01-30 20:59:12 +08:00
|
|
|
];
|
|
|
|
}
|