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 {