This commit is contained in:
fengchuanhn@gmail.com
2026-05-21 01:47:16 +08:00
parent 3b0a8d777c
commit 54f080fbc1
22 changed files with 1106 additions and 36 deletions

View File

@@ -0,0 +1,27 @@
import { invoke } from "@tauri-apps/api/core";
/**
* 经 Rust 读取本地 oem 文件中的 ID并请求公开品牌 API。
* @returns {Promise<{
* oemId: number,
* softwareName: string,
* logoUrl: string | null,
* wechat: string | null,
* }>}
*/
export async function fetchSoftwareInfo() {
try {
const data = await invoke("get_software_info");
if (!data || typeof data !== "object") {
return { oemId: 1, softwareName: "", logoUrl: null, wechat: null };
}
return {
oemId: data.oemId ?? 1,
softwareName: data.softwareName ?? "",
logoUrl: data.logoUrl || null,
wechat: data.wechat || null,
};
} catch {
return { oemId: 1, softwareName: "", logoUrl: null, wechat: null };
}
}