From e5c1987eaa006c247da1b568e15ae28f37e015a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= Date: Thu, 12 Nov 2026 14:05:47 +0800 Subject: [PATCH] feat(auth): improve license agreement logic (#14410) --- core/app/api/v2/auth.go | 23 +++++++++-------- core/app/dto/setting.go | 25 ++++++++++--------- core/utils/xpack/community.go | 4 +++ frontend/src/api/interface/auth.ts | 1 + .../src/views/login/components/login-form.vue | 22 ++++++++++------ 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/core/app/api/v2/auth.go b/core/app/api/v2/auth.go index 4ea76aa7c..5dbeee307 100644 --- a/core/app/api/v2/auth.go +++ b/core/app/api/v2/auth.go @@ -236,17 +236,18 @@ func (b *BaseApi) GetLoginSetting(c *gin.Context) { ip := common.GetRealClientIP(c) needCaptcha := global.IPTracker.NeedCaptcha(ip) res := &dto.LoginSetting{ - IsDemo: global.CONF.Base.IsDemo, - IsIntl: global.CONF.Base.Edition == "intl", - IsOffline: global.CONF.Base.IsOffline, - IsEnterprise: global.CONF.Base.IsEnterprise, - Language: settingInfo.Language, - MenuTabs: settingInfo.MenuTabs, - MenuAccordion: settingInfo.MenuAccordion, - PanelCache: settingInfo.PanelCache, - PanelName: settingInfo.PanelName, - Theme: settingInfo.Theme, - NeedCaptcha: needCaptcha, + IsDemo: global.CONF.Base.IsDemo, + IsIntl: global.CONF.Base.Edition == "intl", + IsOffline: global.CONF.Base.IsOffline, + IsEnterprise: global.CONF.Base.IsEnterprise, + IsMasterProductPro: xpack.IsMasterProductPro(), + Language: settingInfo.Language, + MenuTabs: settingInfo.MenuTabs, + MenuAccordion: settingInfo.MenuAccordion, + PanelCache: settingInfo.PanelCache, + PanelName: settingInfo.PanelName, + Theme: settingInfo.Theme, + NeedCaptcha: needCaptcha, } res.PasskeySetting = xpack.AuthProvider.PasskeyStatus(c) helper.SuccessWithData(c, res) diff --git a/core/app/dto/setting.go b/core/app/dto/setting.go index a33220237..b0bb156aa 100644 --- a/core/app/dto/setting.go +++ b/core/app/dto/setting.go @@ -293,18 +293,19 @@ type AppstoreConfig struct { } type LoginSetting struct { - IsDemo bool `json:"isDemo"` - IsIntl bool `json:"isIntl"` - IsOffline bool `json:"isOffline"` - IsEnterprise bool `json:"isEnterprise"` - Language string `json:"language"` - MenuTabs string `json:"menuTabs"` - MenuAccordion string `json:"menuAccordion"` - PanelCache string `json:"panelCache"` - PanelName string `json:"panelName"` - Theme string `json:"theme"` - NeedCaptcha bool `json:"needCaptcha"` - PasskeySetting bool `json:"passkeySetting"` + IsDemo bool `json:"isDemo"` + IsIntl bool `json:"isIntl"` + IsOffline bool `json:"isOffline"` + IsEnterprise bool `json:"isEnterprise"` + IsMasterProductPro bool `json:"isMasterProductPro"` + Language string `json:"language"` + MenuTabs string `json:"menuTabs"` + MenuAccordion string `json:"menuAccordion"` + PanelCache string `json:"panelCache"` + PanelName string `json:"panelName"` + Theme string `json:"theme"` + NeedCaptcha bool `json:"needCaptcha"` + PasskeySetting bool `json:"passkeySetting"` } type PasskeyRegisterRequest struct { diff --git a/core/utils/xpack/community.go b/core/utils/xpack/community.go index 54c99746d..f407b12fb 100644 --- a/core/utils/xpack/community.go +++ b/core/utils/xpack/community.go @@ -11,6 +11,10 @@ var AuthProvider = helper.NewIAuthProvider() var MultiNodeProvider = helper.NewIMultiNodeProvider() +func IsMasterProductPro() bool { + return false +} + func VMCountLimit(_ *gin.Context) int { return 1 } diff --git a/frontend/src/api/interface/auth.ts b/frontend/src/api/interface/auth.ts index 902649129..4a506e1fa 100644 --- a/frontend/src/api/interface/auth.ts +++ b/frontend/src/api/interface/auth.ts @@ -81,6 +81,7 @@ export namespace Login { theme: string; isOffline: boolean; isEnterprise: boolean; + isMasterProductPro: boolean; needCaptcha: boolean; passkeySetting: boolean; } diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 25a35f5ee..5157f502e 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -130,7 +130,7 @@ {{ $t('commons.login.passkeyToPassword') }} - +