Parcourir la source

修改入口文件,调整上传图片路径

sugar1569 il y a 7 ans
Parent
commit
b551e20fc1

+ 6 - 1
application/admin/controller/Common.php

@@ -14,7 +14,12 @@ class Common extends AuthController
 {
 {
     public function rmPublicResource($url)
     public function rmPublicResource($url)
     {
     {
-        $res = UtilService::rmPublicResource($url);
+        if(strpos($url,'public') !== false){
+            $res = UtilService::rmPublicResource($url);
+        }else{
+            $url = ltrim('public'.$url);
+            $res = UtilService::rmPublicResource($url);
+        }
         if($res->status)
         if($res->status)
             return $this->successful('删除成功!');
             return $this->successful('删除成功!');
         else
         else

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
application/admin/controller/setting/SystemConfig.php


+ 1 - 2
application/admin/controller/widget/Images.php

@@ -58,8 +58,7 @@ class Images extends AuthController
         //产品图片上传记录
         //产品图片上传记录
         $fileInfo = $res->fileInfo->getinfo();
         $fileInfo = $res->fileInfo->getinfo();
         //入口是public需要替换图片路径
         //入口是public需要替换图片路径
-        $res->dir = str_replace('public/uploads/','',$res->dir);
-
+        $res->dir = str_replace('public/uploads','',$res->dir);
         SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,$thumbPath,$pid);
         SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,$thumbPath,$pid);
         $info = array(
         $info = array(
 //            "originalName" => $fileInfo['name'],
 //            "originalName" => $fileInfo['name'],