feat: Kimi 设备授权登录(应用内置 kimi login)+ 外链打开统一走 Rust 命令(v0.6.7)
Release / Version consistency (push) Canceled after 0s
Release / Build (macos-latest) (push) Canceled after 0s
Release / Build (ubuntu-latest) (push) Canceled after 0s
Release / Build (windows-latest) (push) Canceled after 0s

This commit is contained in:
KimiSwitch Dev committed 2026-08-01 14:49:14 +08:00
1 parent fc6789a941
commit ce282524db
12 files changed
+561 -10

No files matched your search

+3 -4
View File
@@ -2,7 +2,6 @@ import { useEffect, useState, type ReactNode } from "react";
import { createPortal } from "react-dom";
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { openUrl } from "@tauri-apps/plugin-opener";
import { useTranslation, type Language } from "../i18n";
import { useTheme, type Theme } from "../hooks/useTheme";
import type { UpdateInfo } from "../hooks/useUpdateCheck";
@@ -110,10 +109,10 @@ export function SettingsModal({
invoke("open_installer", { path: downloadedPath }).catch(() => {});
};
// Open an external link in the system browser. Falls back to a new tab
// when the opener plugin call fails, so a broken click never stays silent.
// Open an external link via the Rust-side opener command (bypasses the JS
// plugin scope); fall back to a new tab when even that fails.
const openExternal = (url: string) => {
openUrl(url).catch(() => {
invoke("open_external_url", { url }).catch(() => {
const w = window.open(url, "_blank");
if (!w) console.error(`failed to open ${url}`);
});