From bd54e86f5b4afd9aa1cad12c452a00d2e3e8e742 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 15 Jan 2026 20:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AESentry=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.vue b/src/App.vue index d4864a84..0c707aa0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,6 +18,7 @@ import showLoading from "@comp/func/loading.js"; import showSnackbar from "@comp/func/snackbar.js"; import OtherApi from "@req/otherReq.js"; import * as Sentry from "@sentry/vue"; +import { commands } from "@skipperndt/plugin-machine-uid"; import TGSqlite from "@Sql/index.js"; import TSUserAccount from "@Sqlm/userAccount.js"; import TSUserAchi from "@Sqlm/userAchi.js"; @@ -248,6 +249,7 @@ async function handleResizeListen(event: Event): Promise { async function listenOnInit(): Promise { console.info("[App][listenOnInit] 监听初始化事件!"); await event.listen("initApp", async () => { + await setSentryUser(); await checkAppLoad(); await checkDeviceFp(); try { @@ -267,6 +269,11 @@ async function listenOnInit(): Promise { }); } +async function setSentryUser(): Promise { + const deviceRes = await commands.getMachineUid(); + if (deviceRes.status === "ok") Sentry.setUser({ id: deviceRes.data.id! }); +} + async function checkAppLoad(): Promise { let checkDB = false; try {