mirror of https://github.com/mindoc-org/mindoc.git
feat:删除项目时删除上传的附件和图片
parent
ef7857e859
commit
100db87c6d
|
@ -413,9 +413,14 @@ func (book *Book) ThoroughDeleteBook(id int) error {
|
||||||
NewLabel().InsertOrUpdateMulti(book.Label)
|
NewLabel().InsertOrUpdateMulti(book.Label)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//删除导出缓存
|
||||||
if err := os.RemoveAll(filepath.Join(conf.GetExportOutputPath(), strconv.Itoa(id))); err != nil {
|
if err := os.RemoveAll(filepath.Join(conf.GetExportOutputPath(), strconv.Itoa(id))); err != nil {
|
||||||
beego.Error("删除项目缓存失败 ->",err)
|
beego.Error("删除项目缓存失败 ->",err)
|
||||||
}
|
}
|
||||||
|
//删除附件和图片
|
||||||
|
if err := os.RemoveAll(filepath.Join(conf.WorkingDirectory,"uploads",book.Identify)); err != nil {
|
||||||
|
beego.Error("删除项目附件和图片失败 ->",err)
|
||||||
|
}
|
||||||
|
|
||||||
return o.Commit()
|
return o.Commit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue