作者 lyh

gx

@@ -170,9 +170,9 @@ class FileController @@ -170,9 +170,9 @@ class FileController
170 $hash = hash_file('md5', $files->getPathname()); 170 $hash = hash_file('md5', $files->getPathname());
171 //查看文件是否存在 171 //查看文件是否存在
172 $fileModel = new File(); 172 $fileModel = new File();
173 - $file_hash = $fileModel->read(['hash'=>$hash,'file_link'=>$this->getFileUrl($fileModel,$hash)]); 173 + $file_hash = $fileModel->read(['hash'=>$hash]);
174 if($file_hash !== false){ 174 if($file_hash !== false){
175 - return $this->response('资源',Code::SUCCESS,['file'=>$hash]); 175 + return $this->response('资源',Code::SUCCESS,['file'=>$hash,'file_link'=>$this->getFileUrl($fileModel,$hash)]);
176 } 176 }
177 $url = $this->config['root'].$this->path; 177 $url = $this->config['root'].$this->path;
178 $fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension(); 178 $fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();