111 lines
2.8 KiB
PHP
111 lines
2.8 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | 开源版本可自由商用,可去除界面版权logo
|
||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||
// | 访问官网:https://www.likeadmin.cn
|
||
// | likeadmin团队 版权所有 拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeadminTeam
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\adminapi\validate\user;
|
||
|
||
|
||
use app\common\validate\BaseValidate;
|
||
|
||
|
||
/**
|
||
* 用户菜单验证器
|
||
* Class UserMenuValidate
|
||
* @package app\adminapi\validate\user
|
||
*/
|
||
class UserMenuValidate extends BaseValidate
|
||
{
|
||
|
||
/**
|
||
* 设置校验规则
|
||
* @var string[]
|
||
*/
|
||
protected $rule = [
|
||
'id' => 'require',
|
||
'pid' => 'require',
|
||
'type' => 'require',
|
||
'name' => 'require',
|
||
'icon' => 'require',
|
||
'sort' => 'require',
|
||
'paths' => 'require',
|
||
'is_show' => 'require',
|
||
'is_disable' => 'require',
|
||
];
|
||
|
||
|
||
/**
|
||
* 参数描述
|
||
* @var string[]
|
||
*/
|
||
protected $field = [
|
||
'id' => 'id',
|
||
'pid' => '上级菜单',
|
||
'type' => '权限类型: M=目录,C=菜单,A=按钮',
|
||
'name' => '菜单名称',
|
||
'icon' => '菜单图标',
|
||
'sort' => '菜单排序',
|
||
'paths' => '路由地址',
|
||
'params' => '路由参数',
|
||
'is_show' => '是否显示: 0=否, 1=是',
|
||
'is_disable' => '是否禁用: 0=否, 1=是',
|
||
];
|
||
|
||
|
||
/**
|
||
* @notes 添加场景
|
||
* @return UserMenuValidate
|
||
* @author likeadmin
|
||
* @date 2023/08/23 09:38
|
||
*/
|
||
public function sceneAdd()
|
||
{
|
||
return $this->only(['pid','type','name','icon','sort','paths','params','is_show','is_disable']);
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 编辑场景
|
||
* @return UserMenuValidate
|
||
* @author likeadmin
|
||
* @date 2023/08/23 09:38
|
||
*/
|
||
public function sceneEdit()
|
||
{
|
||
return $this->only(['id','pid','type','name','icon','sort','paths','params','is_show','is_disable']);
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 删除场景
|
||
* @return UserMenuValidate
|
||
* @author likeadmin
|
||
* @date 2023/08/23 09:38
|
||
*/
|
||
public function sceneDelete()
|
||
{
|
||
return $this->only(['id']);
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 详情场景
|
||
* @return UserMenuValidate
|
||
* @author likeadmin
|
||
* @date 2023/08/23 09:38
|
||
*/
|
||
public function sceneDetail()
|
||
{
|
||
return $this->only(['id']);
|
||
}
|
||
|
||
} |