feat: support enterprise resource urls (#12669)

This commit is contained in:
ssongliu
2026-05-21 12:37:32 +08:00
committed by zhengkunwang223
parent d7242d526c
commit 6dc5deb6d3
4 changed files with 29 additions and 9 deletions
+1
View File
@@ -4,6 +4,7 @@ base:
is_demo: false
is_offline: false
is_fxplay: false
is_enterprise: true
log:
level: debug
+10 -9
View File
@@ -7,15 +7,16 @@ type ServerConfig struct {
}
type Base struct {
Port string `mapstructure:"port"`
IsFxplay bool `mapstructure:"is_fxplay"`
Edition string `mapstructure:"edition"` // [ cn / intl]
Version string `mapstructure:"version"`
EncryptKey string `mapstructure:"encrypt_key"`
Mode string `mapstructure:"mode"` // xpack [ Enable / Disable ]
IsDemo bool `mapstructure:"is_demo"`
InstallDir string `mapstructure:"install_dir"`
IsOffline bool `mapstructure:"is_offline"`
Port string `mapstructure:"port"`
IsFxplay bool `mapstructure:"is_fxplay"`
IsEnterprise bool `mapstructure:"is_enterprise"`
Edition string `mapstructure:"edition"` // [ cn / intl]
Version string `mapstructure:"version"`
EncryptKey string `mapstructure:"encrypt_key"`
Mode string `mapstructure:"mode"` // xpack [ Enable / Disable ]
IsDemo bool `mapstructure:"is_demo"`
InstallDir string `mapstructure:"install_dir"`
IsOffline bool `mapstructure:"is_offline"`
}
type SystemDir struct {
+9
View File
@@ -42,6 +42,9 @@ var (
)
func RepoURL() string {
if CONF.Base.IsEnterprise {
return "https://resource.fit2cloud.com/1panel/package/enterprise"
}
if CONF.Base.IsFxplay {
return "https://resource.fit2cloud.com/1panel/package/fusionxplay"
}
@@ -51,6 +54,9 @@ func RepoURL() string {
return "https://resource.1panel.pro/v2"
}
func ResourceURL() string {
if CONF.Base.IsEnterprise {
return "https://resource.fit2cloud.com/1panel/resource/enterprise"
}
if CONF.Base.IsFxplay {
return "https://resource.fit2cloud.com/1panel/resource/fusionxplay"
}
@@ -60,6 +66,9 @@ func ResourceURL() string {
return "https://resource.1panel.pro/v2/resource"
}
func AppRepoURL() string {
if CONF.Base.IsEnterprise {
return "https://apps-assets.fit2cloud.com"
}
if CONF.Base.IsFxplay {
return "https://apps-assets.fit2cloud.com"
}
+9
View File
@@ -35,6 +35,9 @@ var (
type DBOption func(*gorm.DB) *gorm.DB
func RepoURL() string {
if CONF.Base.IsEnterprise {
return "https://resource.fit2cloud.com/1panel/package/enterprise"
}
if CONF.Base.IsFxplay {
return "https://resource.fit2cloud.com/1panel/package/fusionxplay"
}
@@ -44,6 +47,9 @@ func RepoURL() string {
return "https://resource.1panel.pro/v2"
}
func ResourceURL() string {
if CONF.Base.IsEnterprise {
return "https://resource.fit2cloud.com/1panel/resource/enterprise"
}
if CONF.Base.IsFxplay {
return "https://resource.fit2cloud.com/1panel/resource/fusionxplay"
}
@@ -53,6 +59,9 @@ func ResourceURL() string {
return "https://resource.1panel.pro/v2/resource"
}
func AppRepoURL() string {
if CONF.Base.IsEnterprise {
return "https://apps-assets.fit2cloud.com"
}
if CONF.Base.IsFxplay {
return "https://apps-assets.fit2cloud.com"
}