feat(custom): CNY native billing, daily check-in button, subscription plans page, usage docs and promo banner
Based on QuantumNous/new-api v1.0.0-rc.36 (shallow history squashed). - CNY quota display mode: RMB-denominated top-up and crediting across Epay/Waffo channels - New CheckinButton in both authenticated and public headers (Turnstile supported) - New /subscribe page with public plan snapshot, Alipay/balance payment, auto group upgrade/reset - New /docs 12-section beginner guide with anchor navigation - New home PromoBanner linking to /docs; i18n synced (en/zh/zh-TW/fr/ja/ru/vi) - README: document custom features, live demo https://ai.88531.cn
This commit is contained in:
commit
14a9acd368
2368 files changed
+551035
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package system_setting
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/QuantumNous/new-api/setting/config"
|
||||
)
|
||||
|
||||
type OIDCSettings struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
DisplayName string `json:"display_name"`
|
||||
ClientId string `json:"client_id"`
|
||||
ClientSecret string `json:"client_secret"`
|
||||
WellKnown string `json:"well_known"`
|
||||
AuthorizationEndpoint string `json:"authorization_endpoint"`
|
||||
TokenEndpoint string `json:"token_endpoint"`
|
||||
UserInfoEndpoint string `json:"user_info_endpoint"`
|
||||
}
|
||||
|
||||
// 默认配置
|
||||
var defaultOIDCSettings = OIDCSettings{}
|
||||
|
||||
func init() {
|
||||
// 注册到全局配置管理器
|
||||
config.GlobalConfig.Register("oidc", &defaultOIDCSettings)
|
||||
}
|
||||
|
||||
func GetOIDCSettings() *OIDCSettings {
|
||||
return &defaultOIDCSettings
|
||||
}
|
||||
|
||||
// GetEffectiveDisplayName returns the admin-configured display name, or the
|
||||
// literal "OIDC" when none has been set. Centralizing this fallback keeps the
|
||||
// default in one place for both the OAuth provider name and the public
|
||||
// status payload.
|
||||
func (s *OIDCSettings) GetEffectiveDisplayName() string {
|
||||
if trimmed := strings.TrimSpace(s.DisplayName); trimmed != "" {
|
||||
return trimmed
|
||||
}
|
||||
return "OIDC"
|
||||
}
|
||||
Reference in new issue
Block a user