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:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user