优化结构

This commit is contained in:
Yvan
2026-08-28 15:37:40 +08:00
parent a4ed3a02df
commit 9b1daaf3f6
17 changed files with 100 additions and 64 deletions
+6
View File
@@ -103,6 +103,12 @@ func httpAddress(server *config.Server) string {
}
func swaggerAddress(server *config.Server, admin *config.Admin) string {
if admin != nil && admin.App != nil {
switch strings.ToLower(strings.TrimSpace(admin.App.Env)) {
case "production", "prod", "live", "staging":
return "disabled"
}
}
address := httpAddress(server)
if strings.HasPrefix(address, ":") {
address = "127.0.0.1" + address