|
...
|
...
|
@@ -42,38 +42,14 @@ class TaskLogic extends BaseLogic |
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
if(!empty($info['attachment'])){
|
|
|
|
$info = $this->getFileUrl($info);
|
|
|
|
$info = getFileUrl($info);
|
|
|
|
}
|
|
|
|
if(!empty($info['follow']['attachment'])){
|
|
|
|
$info['follow'] = $this->getFileUrl($info['follow']);
|
|
|
|
$info['follow'] = getFileUrl($info['follow']);
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :处理文件
|
|
|
|
* @name :getFileUrl
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/23 16:15
|
|
|
|
*/
|
|
|
|
public function getFileUrl(&$v){
|
|
|
|
$fileModel = new File();
|
|
|
|
$file_info = $fileModel->read(['hash'=>$v['attachment']]);
|
|
|
|
if($file_info !== false){
|
|
|
|
$v['attachment_name'] = basename($file_info['path']);
|
|
|
|
if($file_info['is_cos'] == 1){
|
|
|
|
$cos = config('filesystems.disks.cos');
|
|
|
|
$cosCdn = $cos['cdn'];
|
|
|
|
$v['attachment'] = $cosCdn.$file_info['path'];
|
|
|
|
}else{
|
|
|
|
$v['attachment'] = url('a/download_files?hash='.$v['attachment']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $v;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存
|
|
|
|
* @name :save
|
...
|
...
|
|