diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 9dea408..1cdf8b7 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -23,6 +23,9 @@ FROM alpine:latest WORKDIR /app ENV TZ=Asia/Shanghai ENV serverName="" +ENV gatewayAddr="" +ENV portalAddr="" + # 定义参数 ARG USE_PROXY diff --git a/internal/common/supplier.go b/internal/common/supplier.go index 1515a08..2bcf0cf 100644 --- a/internal/common/supplier.go +++ b/internal/common/supplier.go @@ -12,6 +12,7 @@ var supplierCode2Name = map[string]string{ "FAT_SIX": "胖小刘", "SELF_THIRD": "自有上游", "STAR_SILENCE": "星寂", + "QIXI": "七喜", } func GetSupplierMap() map[string]string { diff --git a/internal/config/config.go b/internal/config/config.go index c7dcea4..6cb1f84 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,10 @@ package config -import "github.com/beego/beego/v2/server/web" +import ( + "github.com/beego/beego/v2/core/config/env" + "github.com/beego/beego/v2/server/web" + "strings" +) type RedisConfig struct { Host string `json:"host"` @@ -14,12 +18,23 @@ type Secret struct { IV string `json:"iv"` } -func GetGatewayHost() string { +func GetGatewayHost() (url string) { + url = env.Get("gatewayAddr", url) + if url != "" { + if !strings.HasSuffix(url, "/") { + url += "/" + } + return + } host, _ := web.AppConfig.String("gateway::host") return host } -func GetPortalHost() string { +func GetPortalHost() (url string) { + url = env.Get("portalAddr", url) + if url != "" { + return + } host, _ := web.AppConfig.String("portal::host") return host } diff --git a/views/merchant.html b/views/merchant.html index dee0670..45913b1 100644 --- a/views/merchant.html +++ b/views/merchant.html @@ -265,26 +265,6 @@