From e6d40d0a93293ecd72740fd6941e635970836f1d Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 26 Jun 2026 20:57:26 +0800 Subject: [PATCH] feat(presets): add OpenCode Go referral link and promo copy without partner badge Decouple the in-app promotion banner from isPartner so a preset can show a promo phrase plus referral link without earning the paid-partner star. - ApiKeySection: gate the banner on partnerPromotionKey alone; the star is still driven solely by isPartner. This also un-suppresses the existing MiniMax cn/en promos, which already carried copy without isPartner. - OpenCode Go (claude/codex/opencode): point apiKeyUrl at the referral link and add partnerPromotionKey "opencode_go" (no isPartner set). - i18n: add the opencode_go promo string across zh/en/ja/zh-TW. --- src/components/providers/forms/shared/ApiKeySection.tsx | 5 ++--- src/config/claudeProviderPresets.ts | 3 ++- src/config/codexProviderPresets.ts | 3 ++- src/config/opencodeProviderPresets.ts | 3 ++- src/i18n/locales/en.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/zh-TW.json | 1 + src/i18n/locales/zh.json | 1 + 8 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/providers/forms/shared/ApiKeySection.tsx b/src/components/providers/forms/shared/ApiKeySection.tsx index b873eb0c2..d00c917ab 100644 --- a/src/components/providers/forms/shared/ApiKeySection.tsx +++ b/src/components/providers/forms/shared/ApiKeySection.tsx @@ -29,7 +29,6 @@ export function ApiKeySection({ websiteUrl, placeholder, disabled, - isPartner, partnerPromotionKey, }: ApiKeySectionProps) { const { t } = useTranslation(); @@ -73,8 +72,8 @@ export function ApiKeySection({ })} - {/* 合作伙伴促销信息 */} - {isPartner && partnerPromotionKey && ( + {/* 促销信息(与 isPartner 解耦:仅凭 partnerPromotionKey 即可展示,星标仍由 isPartner 控制) */} + {partnerPromotionKey && (

💡{" "} diff --git a/src/config/claudeProviderPresets.ts b/src/config/claudeProviderPresets.ts index c6c528131..893d7bdf7 100644 --- a/src/config/claudeProviderPresets.ts +++ b/src/config/claudeProviderPresets.ts @@ -282,7 +282,8 @@ export const providerPresets: ProviderPreset[] = [ { name: "OpenCode Go", websiteUrl: "https://opencode.ai/go", - apiKeyUrl: "https://opencode.ai/auth", + apiKeyUrl: "https://opencode.ai/go?ref=2YTRG2NGTX", + partnerPromotionKey: "opencode_go", settingsConfig: { env: { ANTHROPIC_BASE_URL: "https://opencode.ai/zen/go", diff --git a/src/config/codexProviderPresets.ts b/src/config/codexProviderPresets.ts index 8affe924d..01bb6a9c1 100644 --- a/src/config/codexProviderPresets.ts +++ b/src/config/codexProviderPresets.ts @@ -802,7 +802,8 @@ requires_openai_auth = true`, { name: "OpenCode Go", websiteUrl: "https://opencode.ai/go", - apiKeyUrl: "https://opencode.ai/auth", + apiKeyUrl: "https://opencode.ai/go?ref=2YTRG2NGTX", + partnerPromotionKey: "opencode_go", auth: generateThirdPartyAuth(""), config: generateThirdPartyConfig( "opencode_go", diff --git a/src/config/opencodeProviderPresets.ts b/src/config/opencodeProviderPresets.ts index 952cf3e47..396f74e80 100644 --- a/src/config/opencodeProviderPresets.ts +++ b/src/config/opencodeProviderPresets.ts @@ -1049,7 +1049,8 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [ { name: "OpenCode Go", websiteUrl: "https://opencode.ai/go", - apiKeyUrl: "https://opencode.ai/auth", + apiKeyUrl: "https://opencode.ai/go?ref=2YTRG2NGTX", + partnerPromotionKey: "opencode_go", settingsConfig: { npm: "@ai-sdk/openai-compatible", name: "OpenCode Go", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 5b52d2b7b..371b2f92e 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -1006,6 +1006,7 @@ "runapi": "RunAPI offers special benefits for CC Switch users. Register via this link and contact customer support to claim ¥14 free credit.", "minimax_cn": "MiniMax Coding Plan Special Offer, Starter from ¥9.9", "minimax_en": "MiniMax Coding Plan Black Friday, Starter is now $2/mo (80% OFF!)", + "opencode_go": "Subscribe to OpenCode Go via this link — only $5 for your first month, plus an extra $5 in credit!", "dmxapi": "Claude Code exclusive model 66% OFF now!", "cubence": "Cubence is an official partner of CC Switch. Register using this link and enter \"CCSWITCH\" promo code during recharge to get 10% off every top-up", "aigocode": "AIGoCode is an official partner of CC Switch. Register using this link and get 10% bonus credit on your first top-up!", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index c129bc413..5bf41606e 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -1006,6 +1006,7 @@ "runapi": "RunAPI は CC Switch ユーザーに特別な特典を提供しています。このリンクから登録しカスタマーサポートにご連絡いただくと、¥14 の無料クレジットを受け取ることができます。", "minimax_cn": "MiniMax Coding Plan 特別価格、Starter ¥9.9 から", "minimax_en": "MiniMax Coding Plan Black Friday、Starter が月額 $2(80% OFF)", + "opencode_go": "このリンクから OpenCode Go を購読すると、初月はわずか $5、さらに $5 分のクレジットがもらえます!", "dmxapi": "Claude Code 専用モデル 66% OFF 実施中!", "cubence": "Cubence は CC Switch の公式パートナーです。登録後チャージ時に \"CCSWITCH\" を入力すると、毎回 10% オフ", "aigocode": "AIGoCode は CC Switch の公式パートナーです。このリンクから登録すると、初回チャージ時に 10% のボーナスクレジットがもらえます!", diff --git a/src/i18n/locales/zh-TW.json b/src/i18n/locales/zh-TW.json index 60e722202..788f31245 100644 --- a/src/i18n/locales/zh-TW.json +++ b/src/i18n/locales/zh-TW.json @@ -977,6 +977,7 @@ "runapi": "RunAPI 為 CC Switch 的使用者提供了特別福利,透過此連結註冊並聯繫客服可領取 ¥14 免費額度。", "minimax_cn": "MiniMax Coding Plan 特惠,Starter 方案 9.9 元起", "minimax_en": "MiniMax Coding Plan 黑五特惠,Starter 方案現僅 $2 / 月(2 折優惠!)", + "opencode_go": "使用此連結訂閱 OpenCode Go,首月僅需 $5,並可獲得額外的 $5 額度!", "dmxapi": "Claude Code 專屬模型 3.4 折優惠進行中!", "cubence": "Cubence 是 CC Switch 的官方合作夥伴,使用此連結註冊並在儲值時填寫「CCSWITCH」優惠碼,每次儲值均可享受 9 折優惠", "aigocode": "AIGoCode 是 CC Switch 的官方合作夥伴,使用此連結註冊首次儲值時可以獲得 10% 額度獎勵!", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 3a903250b..d9c7d34ca 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -1006,6 +1006,7 @@ "runapi": "RunAPI 为 CC Switch 的用户提供了特别福利,通过此链接注册并联系客服可领取 ¥14 免费额度。", "minimax_cn": "MiniMax Coding Plan 特惠,Starter 套餐 9.9 元起", "minimax_en": "MiniMax Coding Plan 黑五特惠,Starter 套餐现仅 $2/月(2折优惠!)", + "opencode_go": "使用此链接订阅 OpenCode Go,首月只需 $5,并可获得额外的 $5 额度!", "dmxapi": "Claude Code 专属模型 3.4 折优惠进行中!", "cubence": "Cubence 是 CC Switch 的官方合作伙伴,使用此链接注册并在充值时填写 \"CCSWITCH\" 优惠码,每次充值均可享受9折优惠", "aigocode": "AIGoCode 是 CC Switch 的官方合作伙伴,使用此链接注册首次充值时可以获得10%额度奖励!",