From 2fc6753e426482817a84577f0b81841b1bee784d Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 11 May 2026 15:24:29 +0800 Subject: [PATCH] chore(brand): surface ccswitch.io as the sole official website MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an "Only Official Website" header to the three READMEs, an About panel button, and a tray menu entry — all pointing to ccswitch.io. Consolidates brand and SEO signals on the canonical domain across docs, GUI, and system tray. --- README.md | 2 ++ README_JA.md | 2 ++ README_ZH.md | 2 ++ src-tauri/src/tray.rs | 25 ++++++++++++++++++++++-- src/components/settings/AboutSection.tsx | 11 +++++++++++ src/i18n/locales/en.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/zh.json | 1 + 8 files changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 025517f67..6ac7f0d62 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ farion1231%2Fcc-switch | Trendshift +### 🌐 The Only Official Website: **[ccswitch.io](https://ccswitch.io)** + English | [中文](README_ZH.md) | [日本語](README_JA.md) | [Changelog](CHANGELOG.md) diff --git a/README_JA.md b/README_JA.md index 85bf12863..757b48461 100644 --- a/README_JA.md +++ b/README_JA.md @@ -11,6 +11,8 @@ farion1231%2Fcc-switch | Trendshift +### 🌐 唯一の公式サイト:**[ccswitch.io](https://ccswitch.io)** + [English](README.md) | [中文](README_ZH.md) | 日本語 | [Changelog](CHANGELOG.md) diff --git a/README_ZH.md b/README_ZH.md index 36b1704e6..39077fc46 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -11,6 +11,8 @@ farion1231%2Fcc-switch | Trendshift +### 🌐 唯一官方网站:**[ccswitch.io](https://ccswitch.io)** + [English](README.md) | 中文 | [日本語](README_JA.md) | [更新日志](CHANGELOG.md) diff --git a/src-tauri/src/tray.rs b/src-tauri/src/tray.rs index b96ce839b..42072312f 100644 --- a/src-tauri/src/tray.rs +++ b/src-tauri/src/tray.rs @@ -5,6 +5,7 @@ use once_cell::sync::Lazy; use tauri::menu::{CheckMenuItem, Menu, MenuBuilder, MenuItem, Submenu, SubmenuBuilder}; use tauri::{Emitter, Manager}; +use tauri_plugin_opener::OpenerExt; use crate::app_config::AppType; use crate::error::AppError; @@ -20,6 +21,7 @@ static TRAY_SECTION_SUBMENUS: Lazy< #[derive(Clone, Copy)] pub struct TrayTexts { pub show_main: &'static str, + pub open_website: &'static str, pub no_providers_label: &'static str, pub lightweight_mode: &'static str, pub quit: &'static str, @@ -31,6 +33,7 @@ impl TrayTexts { match language { "en" => Self { show_main: "Open main window", + open_website: "Open Official Website", no_providers_label: "(no providers)", lightweight_mode: "Lightweight Mode", quit: "Quit", @@ -38,6 +41,7 @@ impl TrayTexts { }, "ja" => Self { show_main: "メインウィンドウを開く", + open_website: "公式サイトを開く", no_providers_label: "(プロバイダーなし)", lightweight_mode: "軽量モード", quit: "終了", @@ -45,6 +49,7 @@ impl TrayTexts { }, _ => Self { show_main: "打开主界面", + open_website: "打开官方网站", no_providers_label: "(无供应商)", lightweight_mode: "轻量模式", quit: "退出", @@ -473,11 +478,22 @@ pub fn create_tray_menu( let mut section_handles: std::collections::HashMap> = std::collections::HashMap::new(); - // 顶部:打开主界面 + // 顶部:打开主界面 / 打开官方网站 let show_main_item = MenuItem::with_id(app, "show_main", tray_texts.show_main, true, None::<&str>) .map_err(|e| AppError::Message(format!("创建打开主界面菜单失败: {e}")))?; - menu_builder = menu_builder.item(&show_main_item).separator(); + let open_website_item = MenuItem::with_id( + app, + "open_website", + tray_texts.open_website, + true, + None::<&str>, + ) + .map_err(|e| AppError::Message(format!("创建打开官方网站菜单失败: {e}")))?; + menu_builder = menu_builder + .item(&show_main_item) + .item(&open_website_item) + .separator(); // Pre-compute proxy running state (used to disable official providers in tray menu) let is_proxy_running = futures::executor::block_on(app_state.proxy_service.is_running()); @@ -686,6 +702,11 @@ pub fn handle_tray_menu_event(app: &tauri::AppHandle, event_id: &str) { } } } + "open_website" => { + if let Err(e) = app.opener().open_url("https://ccswitch.io", None::) { + log::error!("打开官方网站失败: {e}"); + } + } "lightweight_mode" => { if crate::lightweight::is_lightweight_mode() { if let Err(e) = crate::lightweight::exit_lightweight_mode(app) { diff --git a/src/components/settings/AboutSection.tsx b/src/components/settings/AboutSection.tsx index ac0c9ffb2..dd827aef2 100644 --- a/src/components/settings/AboutSection.tsx +++ b/src/components/settings/AboutSection.tsx @@ -3,6 +3,7 @@ import { Download, Copy, ExternalLink, + Globe, Info, Loader2, RefreshCw, @@ -360,6 +361,16 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
+