作者 lyh

gx

@@ -379,13 +379,25 @@ class ImageController extends Controller @@ -379,13 +379,25 @@ 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 ($file->getSize() > $max) {  
383 - $this->response('图片最大为500K',Code::SYSTEM_ERROR); 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{
  387 + if ($file->getSize() > $max) {
  388 + $this->response('图片最大为500K',Code::SYSTEM_ERROR);
  389 + }
384 } 390 }
385 } 391 }
386 }else{ 392 }else{
387 - if ($files->getSize() > $max) {  
388 - $this->response('图片最大为500K',Code::SYSTEM_ERROR); 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 + }
  397 + }else{
  398 + if ($files->getSize() > $max) {
  399 + $this->response('图片最大为500K',Code::SYSTEM_ERROR);
  400 + }
389 } 401 }
390 } 402 }
391 if(!isset($this->param['upload_method'])){ 403 if(!isset($this->param['upload_method'])){