前端添加、删除文件和反馈提示改为服务器回调信息,去除无用文件,前端版本信息改为由服务器获取,后台可批量插入版本日志
This commit is contained in:
@@ -33,20 +33,25 @@ public class DeleteController {
|
||||
*/
|
||||
@RequestMapping("/home/filedelete")
|
||||
@ResponseBody
|
||||
public void delete(@RequestParam(value = "fileid") Integer fileid)throws Exception {
|
||||
public boolean delete(@RequestParam(value = "fileid") Integer fileid)throws Exception {
|
||||
TbFile tbFile = new TbFile();
|
||||
tbFile.setColfileid(fileid);
|
||||
TbFile resfile = fileService.findFileById(tbFile);
|
||||
File filepath = new File(resfile.getColfilepath());
|
||||
if (!filepath.exists()) {
|
||||
log.error("删除文件失败:" + resfile.getColfilename() + "不存在!");
|
||||
return false;
|
||||
} else {
|
||||
if (filepath.isFile()){
|
||||
deleteFile(resfile.getColfilepath(),resfile.getColfileid());
|
||||
new UserException(ResultEnum.SUCCESS);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else{
|
||||
deleteDirectory(resfile.getColfilepath());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user