This commit is contained in:
fengchuanhn@gmail.com
2026-05-21 01:53:54 +08:00
parent 54f080fbc1
commit 14cf9b7bf5
6 changed files with 134 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
import { onMounted, onUnmounted, ref } from "vue";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { fetchSoftwareInfo } from "../api/oemSoftwareInfo.js";
import { applyWindowBranding } from "../services/windowBranding.js";
const software = ref({
softwareName: "",
@@ -55,6 +56,7 @@ onMounted(async () => {
loading.value = true;
software.value = await fetchSoftwareInfo();
loading.value = false;
await applyWindowBranding(software.value);
await syncMaximizedState();
if (isTauri()) {

View File

@@ -0,0 +1,14 @@
const DEFAULT_TITLE = "aiclient";
function isTauri() {
return typeof window !== "undefined" && "__TAURI_INTERNALS__" in window;
}
/**
* 同步浏览器标签标题(任务栏标题/图标由 Rust get_software_info 设置)。
* @param {{ softwareName?: string }} branding
*/
export async function applyWindowBranding({ softwareName } = {}) {
if (!isTauri()) return;
document.title = String(softwareName ?? "").trim() || DEFAULT_TITLE;
}