作者 lyh

gx

... ... @@ -222,7 +222,7 @@ class FileController
*/
public function downLoad(){
$file_model = new File();
$info = $file_model->read(['path' => $this->param['path']]);
$info = $file_model->read(['path' => '/'.str_replace_url($this->param['path'])]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
... ... @@ -304,21 +304,4 @@ class FileController
];
return $data;
}
/**
* @remark :获取下载链接
* @name :getDownloadUrl
* @author :lyh
* @method :post
* @time :2023/7/26 14:00
*/
public function getDownloadUrl(){
$fileModel = new File();
$info = $fileModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -291,7 +291,8 @@ class ImageController extends Controller
*/
public function download(){
$imageModel = new ImageModel();
$info = $imageModel->read(['path' => $this->param['path']]);
;
$info = $imageModel->read(['path' => '/'.str_replace_url($this->param['path'])]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
... ... @@ -395,20 +396,4 @@ class ImageController extends Controller
return $data;
}
/**
* @remark :获取下载链接
* @name :getDownloadUrl
* @author :lyh
* @method :post
* @time :2023/7/26 14:00
*/
public function getDownloadUrl(){
$imageModel = new ImageModel();
$info = $imageModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -61,4 +61,6 @@ class CosService
return $imageUrl;
}
}
... ...