diff --git a/server/gamesapi/mt/Config.go b/server/gamesapi/mt/Config.go index 42b79adb..2fcca349 100644 --- a/server/gamesapi/mt/Config.go +++ b/server/gamesapi/mt/Config.go @@ -3,10 +3,12 @@ package mt import ( "f5" "main/mtb" + "net/url" ) type Config struct { mtb.Config + redirectHost string } type ConfigTable struct { @@ -14,6 +16,14 @@ type ConfigTable struct { selfConf *Config } +func (this *Config) Init0() { + u, err := url.Parse(this.GetRedirectUrl()) + if err != nil { + panic(err) + } + this.redirectHost = u.Host +} + func (this *ConfigTable) GetGameSApiUrl() string { return this.selfConf.GetGamesapiUrl() } @@ -23,7 +33,7 @@ func (this *ConfigTable) GetRedirectUrl() string { } func (this *ConfigTable) GetRedirectHost() string { - return this.selfConf.GetRedirectUrl() + return this.selfConf.redirectHost } func (this *ConfigTable) GetSecretKey() string {