作者 lyh

gx

... ... @@ -304,4 +304,21 @@ 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='.$info['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -396,4 +396,20 @@ 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' => str_replace_url($this->param['path'])]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['image_download'=>url('a/downLoad/images?path='.$info['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...