|
@@ -379,15 +379,27 @@ class ImageController extends Controller |
|
@@ -379,15 +379,27 @@ class ImageController extends Controller |
|
379
|
$max = config('upload.default_b_image')['size']['max'];
|
379
|
$max = config('upload.default_b_image')['size']['max'];
|
|
380
|
if(is_array($files)){
|
380
|
if(is_array($files)){
|
|
381
|
foreach ($files as $file){
|
381
|
foreach ($files as $file){
|
|
|
|
382
|
+ if(isset($this->cache['image_max']) && ($this->cache['image_max'] != 0)){
|
|
|
|
383
|
+ if ($file->getSize() > $this->cache['image_max']) {
|
|
|
|
384
|
+ $this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
|
|
|
385
|
+ }
|
|
|
|
386
|
+ }else{
|
|
382
|
if ($file->getSize() > $max) {
|
387
|
if ($file->getSize() > $max) {
|
|
383
|
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
388
|
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
|
384
|
}
|
389
|
}
|
|
385
|
}
|
390
|
}
|
|
|
|
391
|
+ }
|
|
|
|
392
|
+ }else{
|
|
|
|
393
|
+ if(isset($this->cache['image_max']) && ($this->cache['image_max'] != 0)){
|
|
|
|
394
|
+ if ($files->getSize() > $this->cache['image_max']) {
|
|
|
|
395
|
+ $this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
|
|
|
396
|
+ }
|
|
386
|
}else{
|
397
|
}else{
|
|
387
|
if ($files->getSize() > $max) {
|
398
|
if ($files->getSize() > $max) {
|
|
388
|
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
399
|
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
|
|
389
|
}
|
400
|
}
|
|
390
|
}
|
401
|
}
|
|
|
|
402
|
+ }
|
|
391
|
if(!isset($this->param['upload_method'])){
|
403
|
if(!isset($this->param['upload_method'])){
|
|
392
|
//根据项目上传标识区分上传到cos/本地
|
404
|
//根据项目上传标识区分上传到cos/本地
|
|
393
|
$projectModel = new Project();
|
405
|
$projectModel = new Project();
|