作者 lyh

gx

@@ -222,7 +222,7 @@ class FileController @@ -222,7 +222,7 @@ class FileController
222 */ 222 */
223 public function downLoad(){ 223 public function downLoad(){
224 $file_model = new File(); 224 $file_model = new File();
225 - $info = $file_model->read(['path' => $this->param['path']]); 225 + $info = $file_model->read(['path' => '/'.str_replace_url($this->param['path'])]);
226 if ($info === false) { 226 if ($info === false) {
227 $this->response('指定文件不存在!', Code::USER_ERROR); 227 $this->response('指定文件不存在!', Code::USER_ERROR);
228 } 228 }
@@ -304,21 +304,4 @@ class FileController @@ -304,21 +304,4 @@ class FileController
304 ]; 304 ];
305 return $data; 305 return $data;
306 } 306 }
307 -  
308 - /**  
309 - * @remark :获取下载链接  
310 - * @name :getDownloadUrl  
311 - * @author :lyh  
312 - * @method :post  
313 - * @time :2023/7/26 14:00  
314 - */  
315 - public function getDownloadUrl(){  
316 - $fileModel = new File();  
317 - $info = $fileModel->read(['path' => $this->param['path']]);  
318 - if ($info === false) {  
319 - $this->response('指定文件不存在!', Code::USER_ERROR);  
320 - }  
321 - $data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])];  
322 - $this->response('success',Code::SUCCESS,$data);  
323 - }  
324 } 307 }
@@ -291,7 +291,8 @@ class ImageController extends Controller @@ -291,7 +291,8 @@ class ImageController extends Controller
291 */ 291 */
292 public function download(){ 292 public function download(){
293 $imageModel = new ImageModel(); 293 $imageModel = new ImageModel();
294 - $info = $imageModel->read(['path' => $this->param['path']]); 294 + ;
  295 + $info = $imageModel->read(['path' => '/'.str_replace_url($this->param['path'])]);
295 if ($info === false) { 296 if ($info === false) {
296 $this->response('指定文件不存在!', Code::USER_ERROR); 297 $this->response('指定文件不存在!', Code::USER_ERROR);
297 } 298 }
@@ -395,20 +396,4 @@ class ImageController extends Controller @@ -395,20 +396,4 @@ class ImageController extends Controller
395 return $data; 396 return $data;
396 } 397 }
397 398
398 - /**  
399 - * @remark :获取下载链接  
400 - * @name :getDownloadUrl  
401 - * @author :lyh  
402 - * @method :post  
403 - * @time :2023/7/26 14:00  
404 - */  
405 - public function getDownloadUrl(){  
406 - $imageModel = new ImageModel();  
407 - $info = $imageModel->read(['path' => $this->param['path']]);  
408 - if ($info === false) {  
409 - $this->response('指定文件不存在!', Code::USER_ERROR);  
410 - }  
411 - $data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])];  
412 - $this->response('success',Code::SUCCESS,$data);  
413 - }  
414 } 399 }
@@ -61,4 +61,6 @@ class CosService @@ -61,4 +61,6 @@ class CosService
61 return $imageUrl; 61 return $imageUrl;
62 } 62 }
63 63
  64 +
  65 +
64 } 66 }