作者 lyh

gx

... ... @@ -116,14 +116,14 @@ class ImageController
'path' => $url.$filename,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$filename,
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
];
$rs = $imageModel->add($data);
if ($rs === false) {
return $this->response('添加失败', Code::USER_ERROR);
}
return $hash.$filename;
return $hash;
}
/**
* 生成缩略图缓存
... ... @@ -162,10 +162,10 @@ class ImageController
'path' => $url.$filename,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$filename,
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
];
$data[] = $hash.$filename;
$data[] = $hash;
}
$imageModel = new ImageModel();
$imageModel->insert($save_data);
... ...
... ... @@ -61,8 +61,6 @@ class WebSettingServiceLogic extends BaseLogic
$info = $image->read(['hash'=>$this->param['hash']]);
if($info !== false){
$image->del(['id'=>$info['id']]);
//删除资源文件
shell_exec('rm -rf '.$info['path']);
}
DB::commit();
}catch (\Exception $e){
... ...