更新目录结构
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -26,7 +26,7 @@ class Ad extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'name'],
|
||||
'adminedit' => ['title', 'name'],
|
||||
'add' => ['title', 'name'],
|
||||
'edit' => ['title', 'name'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -25,7 +25,7 @@ class Category extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'model_id'],
|
||||
'adminedit' => ['title', 'model_id'],
|
||||
'add' => ['title', 'model_id'],
|
||||
'edit' => ['title', 'model_id'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -23,7 +23,7 @@ class Channel extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title'],
|
||||
'adminedit' => ['title'],
|
||||
'add' => ['title'],
|
||||
'edit' => ['title'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -15,22 +15,23 @@ use think\Validate;
|
||||
*/
|
||||
class Config extends Validate{
|
||||
protected $rule = [
|
||||
'name' => 'require|unique:config',
|
||||
'name' => 'require|unique:config|alphaDash',
|
||||
'title' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => '配置标识必须',
|
||||
'name.unique' => '配置标识已存在',
|
||||
'name.alphaDash' => '配置标识格式错误',
|
||||
'title.require' => '配置标题必须',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'name'],
|
||||
'add' => ['title', 'name'],
|
||||
];
|
||||
|
||||
// edit 验证场景定义
|
||||
public function sceneAdminedit() {
|
||||
public function sceneEdit() {
|
||||
return $this->only([['title', 'name']])
|
||||
->remove('name', 'unique');
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
use think\facade\Request;
|
||||
@@ -50,8 +50,8 @@ class Content extends Validate{
|
||||
$this->message = $message;
|
||||
|
||||
$this->scene = [
|
||||
'adminadd' => $field,
|
||||
'adminedit' => $field,
|
||||
'add' => $field,
|
||||
'edit' => $field,
|
||||
'useradd' => $field,
|
||||
'useredit' => $field,
|
||||
];
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -26,7 +26,7 @@ class Link extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'url'],
|
||||
'adminedit' => ['title', 'url'],
|
||||
'add' => ['title', 'url'],
|
||||
'edit' => ['title', 'url'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -23,7 +23,7 @@ class Menu extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title'],
|
||||
'adminedit' => ['title'],
|
||||
'add' => ['title'],
|
||||
'edit' => ['title'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
@@ -27,7 +27,7 @@ class Model extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['title', 'name'],
|
||||
'adminedit' => ['title'],
|
||||
'add' => ['title', 'name'],
|
||||
'edit' => ['title'],
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
use app\model\Member;
|
||||
@@ -39,9 +39,9 @@ class User extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'adminadd' => ['username', 'email', 'password', 'repassword'],
|
||||
'adminedit' => ['username', 'email'],
|
||||
'admineditpwd' => ['uid', 'password', 'repassword', 'oldpassword']
|
||||
'add' => ['username', 'email', 'password', 'repassword'],
|
||||
'edit' => ['username', 'email'],
|
||||
'editpwd' => ['uid', 'password', 'repassword', 'oldpassword']
|
||||
];
|
||||
|
||||
protected function checkOldpaswd($value, $rule, $data){
|
||||
@@ -6,7 +6,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate;
|
||||
namespace app\http\validate\api;
|
||||
|
||||
use think\Validate;
|
||||
use app\model\Member;
|
||||
@@ -28,6 +28,6 @@ class Login extends Validate{
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'apiindex' => ['username', 'password'],
|
||||
'index' => ['username', 'password'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user