更新
This commit is contained in:
25
app/validate/File.php
Normal file
25
app/validate/File.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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;
|
||||
|
||||
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'
|
||||
];
|
||||
protected $message = [
|
||||
'avatar.fileSize' => '图片不大于1M',
|
||||
'avatar.fileExt' => '头像后缀不正确',
|
||||
'avatar.image' => '头像尺寸不正确',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user