|
@@ -8,6 +8,7 @@ import (
|
|
|
"eta_gn/eta_api/services"
|
|
|
knowledgeServ "eta_gn/eta_api/services/knowledge"
|
|
|
"eta_gn/eta_api/utils"
|
|
|
+ "fmt"
|
|
|
"github.com/h2non/filetype"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"github.com/tealeg/xlsx"
|
|
@@ -1154,9 +1155,15 @@ func (this *ResourceController) TemplateDownload() {
|
|
|
downUrl = "./static/template/知识库上传模板.xlsx"
|
|
|
fileName = "知识库上传模板.xlsx"
|
|
|
default:
|
|
|
- downUrl = "./static/template/事件库上传模版.xlsx"
|
|
|
- fileName = "事件库上传模版.xlsx"
|
|
|
+ downUrl = "./static/template/事件库上传模板.xlsx"
|
|
|
+ fileName = "事件库上传模板.xlsx"
|
|
|
}
|
|
|
+ // 判断文件是否存在
|
|
|
+ if _, err := os.Stat(downUrl); os.IsNotExist(err) {
|
|
|
+ br.Msg = "文件不存在"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(downUrl, fileName)
|
|
|
this.Ctx.Output.Download(downUrl, fileName)
|
|
|
//this.Ctx.Output.Download("./static/数据导入模板.xlsx", "数据导入模板.xlsx")
|
|
|
|