修改导出文件并删除

This commit is contained in:
孙肖扬 2025-03-05 16:15:55 +08:00
parent 7ad44130a2
commit c092ced2c2
2 changed files with 0 additions and 13 deletions

View File

@ -6,7 +6,6 @@ import (
"fmt"
"io/ioutil"
"net/http"
"os"
"time"
"github.com/360EntSecGroup-Skylar/excelize"
@ -195,13 +194,6 @@ func ExportRegister(c *gin.Context) {
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
return
}
defer func() {
if err := os.Remove(filePath); err != nil {
logger.Errorf("删除临时文件失败: %v", err)
} else {
logger.Info("临时文件已清理:", filePath)
}
}()
var httpType string
if config.Data.System.IsHttps {
httpType = model.HttpsType

View File

@ -9,7 +9,6 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"time"
@ -80,10 +79,6 @@ func ToExcelByType(titleList []string, dataList []interface{}, dataType string,
var buffer bytes.Buffer
_ = file.Write(&buffer)
if filePath != "" {
dir := filepath.Dir(filePath)
if err = CreateDirPath(dir); err != nil {
return
}
if err = file.Save(filePath); err != nil {
return
}