更新目录结构
This commit is contained in:
@@ -13,13 +13,14 @@ use think\Validate;
|
||||
class File extends Validate{
|
||||
|
||||
protected $rule = [
|
||||
'avatar' => 'fileSize:102400|fileExt:jpg,png',
|
||||
'image' => 'fileSize:204800|fileExt:jpg,jpeg,png,webp',
|
||||
'file' => 'fileSize:1024 * 1000|fileExt:doc,xls,zip,rar'
|
||||
'avatar' => 'fileSize:1048576|fileExt:jpg,png',
|
||||
'image' => 'fileSize:1048576 * 2|fileExt:jpg,jpeg,png,webp',
|
||||
'file' => 'fileSize:1048576 * 5|fileExt:doc,xls,zip,rar'
|
||||
];
|
||||
protected $message = [
|
||||
'avatar.fileSize' => '图片不大于1M',
|
||||
'avatar.fileExt' => '头像后缀不正确',
|
||||
'avatar.image' => '头像尺寸不正确',
|
||||
'image.fileSize' => '图片大小超过允许上传大小'
|
||||
];
|
||||
}
|
||||
@@ -1,27 +1,27 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\auth;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Index extends Validate{
|
||||
|
||||
protected $rule = [
|
||||
'username' => 'require:id',
|
||||
'password' => 'require'
|
||||
];
|
||||
protected $message = [
|
||||
'password.require' => '登录密码必须',
|
||||
'username.require' => '登录用户名必须'
|
||||
];
|
||||
protected $scene = [
|
||||
'login' => ['username', 'password'],
|
||||
'resetpasswd' => ['username', 'password']
|
||||
];
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\admin\auth;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Index extends Validate{
|
||||
|
||||
protected $rule = [
|
||||
'username' => 'require',
|
||||
'password' => 'require'
|
||||
];
|
||||
protected $message = [
|
||||
'password.require' => '登录密码必须',
|
||||
'username.require' => '登录用户名必须'
|
||||
];
|
||||
protected $scene = [
|
||||
'login' => ['username', 'password'],
|
||||
'resetpasswd' => ['username', 'password']
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\auth;
|
||||
namespace app\validate\admin\auth;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
30
app/validate/api/student/Enter.php
Normal file
30
app/validate/api/student/Enter.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\api\student;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Enter extends Validate{
|
||||
|
||||
protected $rule = [
|
||||
'category_id' => 'require',
|
||||
'id_card' => 'require|idCard',
|
||||
'mobile' => 'require|mobile'
|
||||
];
|
||||
protected $message = [
|
||||
'category_id.require' => '科目必选',
|
||||
'id_card.require' => '身份证号码必填',
|
||||
'id_card.idCard' => '身份证号码格式错误',
|
||||
'mobile.require' => '手机号码必填',
|
||||
'mobile.mobile' => '手机号码格式错误'
|
||||
];
|
||||
protected $scene = [
|
||||
'add' => ['category_id', 'id_card']
|
||||
];
|
||||
}
|
||||
36
app/validate/api/student/Login.php
Normal file
36
app/validate/api/student/Login.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\validate\api\student;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Login extends Validate{
|
||||
|
||||
protected $rule = [
|
||||
'name' => 'require|chsAlpha',
|
||||
'mobile' => 'require|mobile|unique:student',
|
||||
'password' => 'require',
|
||||
'repassword'=>'require|confirm:password'
|
||||
];
|
||||
protected $message = [
|
||||
'password.require' => '登录密码必须',
|
||||
'mobile.require' => '手机号码必须',
|
||||
'mobile.mobile' => '手机号码不正确',
|
||||
'mobile.unique' => '当前手机号码已注册',
|
||||
'name.require' => '姓名必须',
|
||||
'name.chsAlpha' => '姓名格式不正确',
|
||||
'repassword.require' => '确认密码必须',
|
||||
'repassword.confirm' => '两次密码输入不同'
|
||||
];
|
||||
protected $scene = [
|
||||
'login' => ['name', 'mobile', 'password'],
|
||||
'register' => ['name', 'mobile', 'password', 'repassword'],
|
||||
'resetpasswd' => ['name', 'password']
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user