From 100db87c6d01ec5c6353285ead32fdcff058912d Mon Sep 17 00:00:00 2001 From: lifei6671 Date: Mon, 20 Aug 2018 15:11:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=97=B6=E5=88=A0=E9=99=A4=E4=B8=8A=E4=BC=A0=E7=9A=84=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=92=8C=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/BookModel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/BookModel.go b/models/BookModel.go index 73c4b03d..1bff453d 100644 --- a/models/BookModel.go +++ b/models/BookModel.go @@ -413,9 +413,14 @@ func (book *Book) ThoroughDeleteBook(id int) error { NewLabel().InsertOrUpdateMulti(book.Label) } + //删除导出缓存 if err := os.RemoveAll(filepath.Join(conf.GetExportOutputPath(), strconv.Itoa(id))); err != nil { beego.Error("删除项目缓存失败 ->",err) } + //删除附件和图片 + if err := os.RemoveAll(filepath.Join(conf.WorkingDirectory,"uploads",book.Identify)); err != nil { + beego.Error("删除项目附件和图片失败 ->",err) + } return o.Commit()