From 64d426be5124f46c16e105ec3f45b17c8869b481 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Wed, 20 Nov 2024 16:11:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E4=B8=8A=E4=BC=A0=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/manager/Upload.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controller/manager/Upload.php b/app/controller/manager/Upload.php index e7f9481..96b639e 100755 --- a/app/controller/manager/Upload.php +++ b/app/controller/manager/Upload.php @@ -25,7 +25,7 @@ class Upload extends BaseController } $this->validate = new VUpload(); $this->uploadPath = Config::get('filesystem.disks.local.url'); - if(is_writable(app()->getRootPath() . 'wwwroot' . $this->uploadPath)){ + if(is_writable(app()->getRootPath() . 'public' . $this->uploadPath)){ $this->uploadPathIsWritable = 1; } } @@ -48,7 +48,7 @@ class Upload extends BaseController return $this->json(1, $errorMsg); } } - + //文件上传(通用) public function file() { @@ -72,7 +72,7 @@ class Upload extends BaseController return $this->json(1, $errorMsg); } } - + //图片上传(通用) public function image() { @@ -108,7 +108,7 @@ class Upload extends BaseController //富文本编辑器商城图片 public function wangImage() { - + $imageArr = request()->file('wang_img'); // 该方式,前端js上传方法中字段名称必须以数组形式传参 如 wang_img[] = 值 $errno = 0; $data = []; @@ -133,7 +133,7 @@ class Upload extends BaseController } } } - + $return['errno'] = $errno; $return['data'] = $data; return json($return); From 25a5c10baeeeb6346361f4ce043ca6c9ea3689ff Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Wed, 20 Nov 2024 16:24:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E8=B7=AF=E5=BE=84=E5=88=B0public?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/Image.php | 12 ++++++------ config/filesystem.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/service/Image.php b/app/service/Image.php index 068be2b..ad03a6a 100755 --- a/app/service/Image.php +++ b/app/service/Image.php @@ -14,7 +14,7 @@ class Image extends File public static function resize($src) { $max = 1920; - $realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src,'/'); + $realPath = app()->getRootPath() . 'public/' . ltrim($src,'/'); if(is_file($realPath)){ $img = TImage::open($realPath); list($img_w,$img_h) = $img->size(); @@ -34,7 +34,7 @@ class Image extends File $rootPath = app()->getRootPath(); if(!empty($src)){ $system = System::getSystem(); - $realPath = $rootPath . 'wwwroot/' . ltrim($src, '/'); + $realPath = $rootPath . 'public/' . ltrim($src, '/'); if(is_file($realPath)){ if($system['is_mark']){ $mark = $rootPath . ltrim($system['mark_img'], '/'); @@ -48,7 +48,7 @@ class Image extends File } } } - + //获取水印位置键值对 public static function getMarkPosition() { @@ -73,7 +73,7 @@ class Image extends File public static function delImg($src) { if(!empty(trim($src))){ - $realPath = app()->getRootPath() . 'wwwroot/' . ltrim($src, '/'); + $realPath = app()->getRootPath() . 'public/' . ltrim($src, '/'); if (file_exists($realPath)) { $info = pathinfo($realPath); $source = $info['dirname'] . DIRECTORY_SEPARATOR . $info['filename'] . '*.' . $info['extension']; @@ -100,7 +100,7 @@ class Image extends File return ''; } $rootPath = app()->getRootPath(); - $realPath = $rootPath . 'wwwroot/' . ltrim($src, '/'); + $realPath = $rootPath . 'public/' . ltrim($src, '/'); $realPath = str_replace('\\', '/', $realPath); if(!file_exists($realPath)){ return ''; @@ -120,7 +120,7 @@ class Image extends File return $src; } $thumbName = $info['dirname']. DIRECTORY_SEPARATOR .$info['filename'].'_'.$width.'_'.$height.'.'.$info['extension']; - $realThumbName = $rootPath . 'wwwroot/' . ltrim($thumbName, '/'); + $realThumbName = $rootPath . 'public/' . ltrim($thumbName, '/'); $realThumbName = str_replace('\\', '/', $realThumbName); if(!file_exists($realThumbName)){ $image = TImage::open($realPath); diff --git a/config/filesystem.php b/config/filesystem.php index 5d636ab..9fce6e1 100755 --- a/config/filesystem.php +++ b/config/filesystem.php @@ -11,7 +11,7 @@ return [ // 磁盘类型 'type' => 'local', // 磁盘路径 - 'root' => app()->getRootPath() . 'wwwroot/storage', + 'root' => app()->getRootPath() . 'public/storage', // 磁盘路径对应的外部URL路径 'url' => '/storage', // 可见性 @@ -21,7 +21,7 @@ return [ // 磁盘类型 'type' => 'local', // 磁盘路径 - 'root' => app()->getRootPath() . 'wwwroot/storage/videos', + 'root' => app()->getRootPath() . 'public/storage/videos', // 磁盘路径对应的外部URL路径 'url' => '/storage/videos', // 可见性 @@ -31,7 +31,7 @@ return [ // 磁盘类型 'type' => 'local', // 磁盘路径 - 'root' => app()->getRootPath() . 'wwwroot/storage/backup', + 'root' => app()->getRootPath() . 'public/storage/backup', // 磁盘路径对应的外部URL路径 'url' => '/storage/backup', // 可见性 From 4d4ee7d9372c5736245d433cffffaf3c45b123d0 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Wed, 20 Nov 2024 16:47:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=8F=96=E6=B6=88=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=E7=9A=84=E5=B0=BA=E5=AF=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/manager/Upload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controller/manager/Upload.php b/app/controller/manager/Upload.php index 96b639e..8e1a971 100755 --- a/app/controller/manager/Upload.php +++ b/app/controller/manager/Upload.php @@ -91,9 +91,9 @@ class Upload extends BaseController $return['thumb_src'] = Image::getThumb($src, 100, 100, TImage::THUMB_SCALING); //上传返回缩略图宽度为100 } $return['src'] = $src; - if($this->isCompress){ - Image::resize($src); - } +// if($this->isCompress){ +// Image::resize($src); +// } File::add($image, $src); //加入上传文件表 } catch (\Exception $e) { return $this->json(1, $e->getMessage());