Files
fdesk/app/common/validate/RoleValidate.php
T
mzl92 a6f2284f51 Merge branch 'feature/mzl_dev' into develop
# Conflicts:
#	app/common/controller/AuthController.php
#	app/common/logic/AuthLogic.php
#	app/common/model/User.php
#	app/controller/IndexController.php
#	app/functions.php
#	app/middleware/AuthCheck.php
#	app/view/index/qrcode.html
#	composer.json
#	composer.lock
#	config/middleware.php
#	config/route.php
#	config/whitelist.php
2025-07-11 15:21:00 +08:00

33 lines
913 B
PHP

<?php
namespace app\common\validate;
use think\Validate;
class RoleValidate extends Validate
{
protected $rule = [
'id' => 'require|integer',
'system_id' => 'require|integer',
'name' => 'require|max:64',
'desc' => 'max:128',
'sort' => 'integer',
'status' => 'in:0,1',
];
protected $message = [
'id.require' => '角色ID不能为空',
'system_id.require' => '系统ID不能为空',
'name.require' => '角色名称不能为空',
'name.max' => '角色名称不能超过64个字符',
'desc.max' => '描述不能超过128个字符',
'sort.integer' => '排序为数字',
'status.in' => '状态值必须为0或1',
];
protected $scene = [
'role_create' => ['system_id', 'name', 'desc', 'sort'],
'role_update' => ['id', 'system_id', 'name', 'desc', 'sort', 'status'],
];
}