WeChat Web QR Code Integration (#1961)

This commit is contained in:
hsguo
2026-03-24 18:37:41 +08:00
committed by GitHub
parent fcc20ec72c
commit fa5ab72022
10 changed files with 661 additions and 11 deletions
+7
View File
@@ -815,6 +815,7 @@ func (c *WeComAIBotConfig) SetSecret(secret string) {
type WeixinConfig struct {
Enabled bool `json:"enabled" env:"PICOCLAW_CHANNELS_WEIXIN_ENABLED"`
token string
AccountID string `json:"account_id,omitempty" env:"PICOCLAW_CHANNELS_WEIXIN_ACCOUNT_ID"`
BaseURL string `json:"base_url" env:"PICOCLAW_CHANNELS_WEIXIN_BASE_URL"`
CDNBaseURL string `json:"cdn_base_url" env:"PICOCLAW_CHANNELS_WEIXIN_CDN_BASE_URL"`
Proxy string `json:"proxy" env:"PICOCLAW_CHANNELS_WEIXIN_PROXY"`
@@ -2019,6 +2020,12 @@ func (c *Config) SecurityCopyFrom(cfg *Config) {
}
}
// ApplySecurity re-applies the stored security config to populate private fields (tokens, API keys, etc.).
// Call this after SecurityCopyFrom when you need private fields to be accessible for validation or use.
func (c *Config) ApplySecurity() error {
return applySecurityConfig(c, c.security)
}
func MergeAPIKeys(apiKey string, apiKeys []string) []string {
seen := make(map[string]struct{})
var all []string