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