作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -67,7 +67,7 @@ class FileController
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$path = $this->config['url'].'/'.$info['path'];
$path = $this->config['root'].'/'.$info['path'];
if (!is_file($path)) {
$this->response('指定文件已被系统删除!', Code::USER_ERROR);
}
... ... @@ -174,6 +174,7 @@ class FileController
'size' => $res->getSize(),
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
'refer'=>$this->param['refer']
];
$rs = $fileModel->add($data);
if ($rs === false) {
... ... @@ -204,7 +205,7 @@ class FileController
$data[] = $hash;
continue;
}
$url = $this->config['url'].'/'.$this->path;
$url = $this->config['root'].'/'.$this->path;
$fileName = uniqid().rand(10000,99999).'.'.$files->getClientOriginalExtension();
$res = $file->move($url,$fileName);
if ($res === false) {
... ... @@ -216,6 +217,7 @@ class FileController
'size' => $res->getSize(),
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
'refer'=>$this->param['refer']
];
$data[] = $hash;
}
... ...