소스 검색

更轻编辑器图片上传缩略图

sugar1569 7 년 전
부모
커밋
21dca05087
2개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 5
      application/admin/controller/system/SystemAttachment.php
  2. 1 1
      application/admin/view/article/article/create.php

+ 2 - 5
application/admin/controller/system/SystemAttachment.php

@@ -26,11 +26,8 @@ class SystemAttachment extends AuthController
         }
         //产品图片上传记录
         $fileInfo = $res->fileInfo->getinfo();
-        //入口是public需要替换图片路径
-        if(strpos(PUBILC_PATH,'public') == false){
-            $res->dir = str_replace('public/','',$res->dir);
-        }
-        SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,'',0);
+        $thumbPath = Upload::thumb($res->dir);
+        SystemAttachmentModel::attachmentAdd($res->fileInfo->getSaveName(),$fileInfo['size'],$fileInfo['type'],$res->dir,$thumbPath,0);
         $info = array(
             "originalName" => $fileInfo['name'],
             "name" => $res->fileInfo->getSaveName(),

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
application/admin/view/article/article/create.php