diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 2c47493..758a501 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -591,7 +591,7 @@ pub async fn check_for_updates(handle: tauri::AppHandle) -> Result handle .opener() .open_url( - "https://github.com/yungookim/cc-switch/releases", + "https://github.com/farion1231/cc-switch/releases", None::, ) .map_err(|e| format!("打开更新页面失败: {}", e))?; diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx index 6627fee..34ee061 100644 --- a/src/components/SettingsModal.tsx +++ b/src/components/SettingsModal.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from "react"; import { X, Info, RefreshCw, FolderOpen } from "lucide-react"; +import { getVersion } from "@tauri-apps/api/app"; import "../lib/tauri-api"; import type { Settings } from "../types"; @@ -12,14 +13,25 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { showInDock: true, }); const [configPath, setConfigPath] = useState(""); - const [version] = useState("1.0.0"); + const [version, setVersion] = useState(""); const [isCheckingUpdate, setIsCheckingUpdate] = useState(false); useEffect(() => { loadSettings(); loadConfigPath(); + loadVersion(); }, []); + const loadVersion = async () => { + try { + const appVersion = await getVersion(); + setVersion(appVersion); + } catch (error) { + console.error("获取版本信息失败:", error); + setVersion("3.1.1"); // 降级使用默认版本 + } + }; + const loadSettings = async () => { try { const loadedSettings = await window.api.getSettings(); @@ -88,8 +100,8 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { {/* 设置内容 */}
- {/* 显示设置 */} -
+ {/* 显示设置 - 功能还未实现 */} + {/*

显示设置

@@ -106,7 +118,7 @@ export default function SettingsModal({ onClose }: SettingsModalProps) { className="w-4 h-4 text-[var(--color-primary)] rounded focus:ring-[var(--color-primary)]/20" /> -
+
*/} {/* 配置文件位置 */}
@@ -151,9 +163,6 @@ export default function SettingsModal({ onClose }: SettingsModalProps) {

版本 {version}

-

- 管理 Claude Code 和 Codex 的 MCP 服务器配置 -