|
@@ -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
|
} |