feat: add Z.ai GLM partner and fix apiKeyUrl priority

- Add Z.ai GLM as official partner with promotion support
- Fix apiKeyUrl not being prioritized for cn_official and aggregator categories
- Now apiKeyUrl (with promotion parameters) takes precedence over websiteUrl for cn_official, aggregator, and third_party categories
This commit is contained in:
Jason
2025-11-06 16:04:10 +08:00
parent 5f78e58ffc
commit 4e23250755
2 changed files with 28 additions and 5 deletions

View File

@@ -49,10 +49,15 @@ export function useApiKeyLink({
const getWebsiteUrl = useMemo(() => {
if (currentPresetEntry) {
const preset = currentPresetEntry.preset;
// 第三方供应商优先使用 apiKeyUrl
return preset.category === "third_party"
? preset.apiKeyUrl || preset.websiteUrl || ""
: preset.websiteUrl || "";
// 对于 cn_official、aggregator、third_party优先使用 apiKeyUrl(可能包含推广参数)
if (
preset.category === "cn_official" ||
preset.category === "aggregator" ||
preset.category === "third_party"
) {
return preset.apiKeyUrl || preset.websiteUrl || "";
}
return preset.websiteUrl || "";
}
return formWebsiteUrl || "";
}, [currentPresetEntry, formWebsiteUrl]);