|
...
|
...
|
@@ -342,7 +342,7 @@ class FileController |
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定文件不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$fileUrl = getFileUrl($info['path'],$info['is_cos']);
|
|
|
|
$fileUrl = getFileUrl($info['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0);
|
|
|
|
// 设置响应头
|
|
|
|
header('Content-Description: File Transfer');
|
|
|
|
header('Content-Type: application/octet-stream');
|
|
...
|
...
|
@@ -392,7 +392,7 @@ class FileController |
|
|
|
$fileModel = new File();
|
|
|
|
$lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']);
|
|
|
|
foreach ($lists as $k => $v){
|
|
|
|
$v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0);
|
|
|
|
$v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0);
|
|
|
|
$lists[$k] = $v;
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
...
|
...
|
@@ -408,7 +408,7 @@ class FileController |
|
|
|
public function responseData($path, $name){
|
|
|
|
$data = [
|
|
|
|
'file'=>$path,
|
|
|
|
'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0),
|
|
|
|
'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0),
|
|
|
|
'name'=>$name,
|
|
|
|
'file_download'=>url('a/download_files?path='.$path)
|
|
|
|
];
|
...
|
...
|
|