You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
shipin/app/adminapi/validate/setting/SystemAdminValidata.php

53 lines
1.6 KiB

<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\validate\setting;
use think\Validate;
class SystemAdminValidata extends Validate
{
/**
* 定义验证规则
* 格式:'字段名' => ['规则1','规则2'...]
*
* @var array
*/
protected $rule = [
'account' => ['require', 'alphaDash'],
'conf_pwd' => 'require',
'pwd' => 'require',
'real_name' => 'require',
'roles' => ['require', 'array'],
];
/**
* 定义错误信息
* 格式:'字段名.规则名' => '错误信息'
*
* @var array
*/
protected $message = [
'account.require' => '400033',
'account.alphaDash' => '400034',
'conf_pwd.require' => '400263',
'pwd.require' => '400256',
'real_name.require' => '400035',
'roles.require' => '400036',
'roles.array' => '400037',
];
protected $scene = [
'get' => ['account', 'pwd'],
'update' => ['account', 'roles'],
];
}