diff --git a/pkg/service/bundle/bundleBalance.go b/pkg/service/bundle/bundleBalance.go index af3b362..e8c4f9c 100644 --- a/pkg/service/bundle/bundleBalance.go +++ b/pkg/service/bundle/bundleBalance.go @@ -290,7 +290,14 @@ func BundleExport(ctx *gin.Context) { service.Error(ctx, err) return } - var exportUrl string = fmt.Sprintf("%s:%s/api/fiee/static/%s",ctx.Request.URL.Scheme, ctx.Request.Host,strings.Replace(filePath, "./runtime/", "", 1)) + var scheme string + if ctx.GetHeader("X-Forwarded-Proto") == "https" { + scheme = "https" + } else { + scheme = "http" + } + + var exportUrl string = fmt.Sprintf("%s:%s/api/fiee/static/%s", scheme, ctx.Request.Host, strings.Replace(filePath, "./runtime/", "", 1)) service.Success(ctx, gin.H{ "url": exportUrl, }) @@ -360,7 +367,7 @@ func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) erro } // 基本信息 - _ = write(1, int(it.Month)) + _ = write(1, it.Month) _ = write(2, it.CustomerNum) _ = write(3, it.UserName) _ = write(4, it.UserPhoneNumber)