From c4a85cb297a4f7c87be60a4bf0286d0b53be7915 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Tue, 25 Nov 2025 17:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/Upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'){