diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index fa2d43589..4042955ec 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -575,9 +575,9 @@ func QueryUserStaticDataPage(ctx *context.Context) { re, count := models.QueryUserStaticDataPage(pageOpts) sheetName := ctx.Tr("user.static.sheetname") filename := sheetName + "_" + startDate + "_" + endDate + ".xlsx" - + os.Remove(setting.AppDataPath + Excel_File_Path + filename) go writeFileToDisk(ctx, count, re, filename) - ctx.Redirect("/api/v1/download_user_define_file?filename=" + filename) + ctx.JSON(http.StatusOK, filename) } else { mapInterface := make(map[string]interface{}) re, count := models.QueryUserStaticDataPage(pageOpts)