From 178eea66a9c588d56bc84649d6eeee032d460d1a Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Wed, 11 Nov 2020 15:22:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=95=86=E5=93=81=E5=A4=8D?= =?UTF-8?q?=E5=88=B6--=E4=BF=AE=E5=A4=8D=E6=97=A7=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Forms/v3/GoodsActivityCopyForm.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Admin/Forms/v3/GoodsActivityCopyForm.php b/app/Admin/Forms/v3/GoodsActivityCopyForm.php index 5a9f282..705437f 100644 --- a/app/Admin/Forms/v3/GoodsActivityCopyForm.php +++ b/app/Admin/Forms/v3/GoodsActivityCopyForm.php @@ -144,10 +144,16 @@ class GoodsActivityCopyForm extends Form implements LazyRenderable public function copyImage($ossImageDir, $imagePath) { $return = ''; - $oldCoverImg = $imagePath; - $customFile = new CustomFileController(); - $result = $customFile->autoCopyFile($ossImageDir, $oldCoverImg); + + // 判断图片是否包含http + if(stripos($imagePath,'http') !== false && @getimagesize($imagePath)){ + // 上传模式 + $result = $customFile->autoUploadFile($ossImageDir, $imagePath); + }else{ + // 复制模式 + $result = $customFile->autoCopyFile($ossImageDir, $imagePath); + }; if($result['status']){ $return = $result['path']; }