diff --git a/app/common/controller/Upload.php b/app/common/controller/Upload.php index 9f7043e..ea758d8 100644 --- a/app/common/controller/Upload.php +++ b/app/common/controller/Upload.php @@ -38,7 +38,7 @@ class Upload extends BaseController if($message){ $message=json_decode($message,true); // 判断链接里的图片 - if (isset($message['content'])) { + if (isset($message['content']) && !empty($message['content'])) { $imagePath = $this->imageFileUrl($message['content']); if (file_exists($imagePath) && !$oldFile) { $fileObj = false; @@ -476,7 +476,7 @@ class Upload extends BaseController // 压缩图片地址 protected function getCompressImg($src, $ext, $prefix) { - $newName2 = uniqid() . '.' . $ext; + $newName2 = uniqid() . rand(0000,9999) . '.' . $ext; $compress_path = $prefix . $newName2; $fullPath = root_path().'public/'; if($this->disk=='local'){