feat: 上传路径调整

main
yin5th 2024-11-20 16:11:37 +08:00
parent fe2181cb8c
commit 64d426be51
1 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ class Upload extends BaseController
} }
$this->validate = new VUpload(); $this->validate = new VUpload();
$this->uploadPath = Config::get('filesystem.disks.local.url'); $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; $this->uploadPathIsWritable = 1;
} }
} }
@ -48,7 +48,7 @@ class Upload extends BaseController
return $this->json(1, $errorMsg); return $this->json(1, $errorMsg);
} }
} }
//文件上传(通用) //文件上传(通用)
public function file() public function file()
{ {
@ -72,7 +72,7 @@ class Upload extends BaseController
return $this->json(1, $errorMsg); return $this->json(1, $errorMsg);
} }
} }
//图片上传(通用) //图片上传(通用)
public function image() public function image()
{ {
@ -108,7 +108,7 @@ class Upload extends BaseController
//富文本编辑器商城图片 //富文本编辑器商城图片
public function wangImage() public function wangImage()
{ {
$imageArr = request()->file('wang_img'); // 该方式前端js上传方法中字段名称必须以数组形式传参 如 wang_img[] = 值 $imageArr = request()->file('wang_img'); // 该方式前端js上传方法中字段名称必须以数组形式传参 如 wang_img[] = 值
$errno = 0; $errno = 0;
$data = []; $data = [];
@ -133,7 +133,7 @@ class Upload extends BaseController
} }
} }
} }
$return['errno'] = $errno; $return['errno'] = $errno;
$return['data'] = $data; $return['data'] = $data;
return json($return); return json($return);