|
...
|
...
|
@@ -56,10 +56,6 @@ class ImageController |
|
|
|
exit;
|
|
|
|
}
|
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$dotIndex = strpos($hash, '.');
|
|
|
|
if ($dotIndex !== false) {
|
|
|
|
$hash = substr($dotIndex, 0, $dotIndex); // 删除小数点及其后面的字符
|
|
|
|
}
|
|
|
|
$info = $imageModel->read(['hash'=>$hash]);
|
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定图片不存在!', Code::USER_ERROR);
|
|
...
|
...
|
@@ -139,7 +135,7 @@ class ImageController |
|
|
|
'path' => $url.$fileName,
|
|
|
|
'created_at' => date('Y-m-d H:i:s',time()),
|
|
|
|
'size' => $res->getSize(),
|
|
|
|
'hash' => $hash.$files->getClientOriginalExtension(),
|
|
|
|
'hash' => $hash,
|
|
|
|
'type'=>$files->getClientOriginalExtension(),
|
|
|
|
];
|
|
|
|
$rs = $imageModel->add($data);
|
|
...
|
...
|
@@ -193,7 +189,7 @@ class ImageController |
|
|
|
'created_at' => date('Y-m-d H:i:s',time()),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s',time()),
|
|
|
|
'size' => $res->getSize(),
|
|
|
|
'hash' => $hash.$files->getClientOriginalExtension(),
|
|
|
|
'hash' => $hash,
|
|
|
|
'type'=>$file->getClientOriginalExtension(),
|
|
|
|
];
|
|
|
|
$data[] = $hash;
|
...
|
...
|
|