refactor: refactor relay part

This commit is contained in:
JustSong
2024-01-21 22:56:20 +08:00
parent e2ed0399f0
commit b373882814
64 changed files with 1092 additions and 793 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/gin-gonic/gin"
"net/http"
"one-api/common"
"one-api/common/logger"
"os"
"strings"
)
@@ -17,7 +18,7 @@ func SetRouter(router *gin.Engine, buildFS embed.FS) {
frontendBaseUrl := os.Getenv("FRONTEND_BASE_URL")
if common.IsMasterNode && frontendBaseUrl != "" {
frontendBaseUrl = ""
common.SysLog("FRONTEND_BASE_URL is ignored on master node")
logger.SysLog("FRONTEND_BASE_URL is ignored on master node")
}
if frontendBaseUrl == "" {
SetWebRouter(router, buildFS)