|
|
@@ -104,4 +104,24 @@ class UploadController extends webApp
|
|
|
return showJson(MESSAGE_OK, true, ['url'=> $file_path, 'path'=> $result['data']['file_path']]);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function deleteImage()
|
|
|
+ {
|
|
|
+ $url = request()->post('url','');
|
|
|
+ if($url){
|
|
|
+ $path = get_image_path($url);
|
|
|
+ if(file_exists(ATTACHMENT_PATH.$path)){
|
|
|
+ @unlink(ATTACHMENT_PATH.$path);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(file_exists(ATTACHMENT_PATH.$path)){
|
|
|
+ @unlink(ATTACHMENT_PATH.$path);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return showJson('操作成功',true);
|
|
|
+ }
|
|
|
+
|
|
|
}
|