作者 lyh

gx

@@ -42,38 +42,14 @@ class TaskLogic extends BaseLogic @@ -42,38 +42,14 @@ class TaskLogic extends BaseLogic
42 $this->fail('error'); 42 $this->fail('error');
43 } 43 }
44 if(!empty($info['attachment'])){ 44 if(!empty($info['attachment'])){
45 - $info = $this->getFileUrl($info); 45 + $info = getFileUrl($info);
46 } 46 }
47 if(!empty($info['follow']['attachment'])){ 47 if(!empty($info['follow']['attachment'])){
48 - $info['follow'] = $this->getFileUrl($info['follow']); 48 + $info['follow'] = getFileUrl($info['follow']);
49 } 49 }
50 return $this->success($info); 50 return $this->success($info);
51 } 51 }
52 -  
53 - /**  
54 - * @remark :处理文件  
55 - * @name :getFileUrl  
56 - * @author :lyh  
57 - * @method :post  
58 - * @time :2023/8/23 16:15  
59 - */  
60 - public function getFileUrl(&$v){  
61 - $fileModel = new File();  
62 - $file_info = $fileModel->read(['hash'=>$v['attachment']]);  
63 - if($file_info !== false){  
64 - $v['attachment_name'] = basename($file_info['path']);  
65 - if($file_info['is_cos'] == 1){  
66 - $cos = config('filesystems.disks.cos');  
67 - $cosCdn = $cos['cdn'];  
68 - $v['attachment'] = $cosCdn.$file_info['path'];  
69 - }else{  
70 - $v['attachment'] = url('a/download_files?hash='.$v['attachment']);  
71 - }  
72 - }  
73 - return $v;  
74 - }  
75 -  
76 - 52 +
77 /** 53 /**
78 * @remark :保存 54 * @remark :保存
79 * @name :save 55 * @name :save