mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
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.
This commit is contained in:
@@ -29,7 +29,6 @@ export function ApiKeySection({
|
||||
websiteUrl,
|
||||
placeholder,
|
||||
disabled,
|
||||
isPartner,
|
||||
partnerPromotionKey,
|
||||
}: ApiKeySectionProps) {
|
||||
const { t } = useTranslation();
|
||||
@@ -73,8 +72,8 @@ export function ApiKeySection({
|
||||
})}
|
||||
</a>
|
||||
|
||||
{/* 合作伙伴促销信息 */}
|
||||
{isPartner && partnerPromotionKey && (
|
||||
{/* 促销信息(与 isPartner 解耦:仅凭 partnerPromotionKey 即可展示,星标仍由 isPartner 控制) */}
|
||||
{partnerPromotionKey && (
|
||||
<div className="rounded-md bg-blue-50 dark:bg-blue-950/30 p-2.5 border border-blue-200 dark:border-blue-800">
|
||||
<p className="text-xs leading-relaxed text-blue-700 dark:text-blue-300">
|
||||
💡{" "}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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!",
|
||||
|
||||
@@ -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% のボーナスクレジットがもらえます!",
|
||||
|
||||
@@ -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% 額度獎勵!",
|
||||
|
||||
@@ -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%额度奖励!",
|
||||
|
||||
Reference in New Issue
Block a user