diff --git a/components.d.ts b/components.d.ts index 659e401..73b9afa 100644 --- a/components.d.ts +++ b/components.d.ts @@ -40,7 +40,6 @@ declare module 'vue' { NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] NModalProvider: typeof import('naive-ui')['NModalProvider'] - NOption: typeof import('naive-ui')['NOption'] NP: typeof import('naive-ui')['NP'] NPopover: typeof import('naive-ui')['NPopover'] NProgress: typeof import('naive-ui')['NProgress'] diff --git a/src/App.vue b/src/App.vue index 1e1fb13..87927f2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,6 +15,7 @@ import UnbindMacs from "./pages/UnbindMacs.vue"; import SpeedTest from "./pages/SpeedTest.vue"; import MonthlyUserLog from "./pages/MonthlyUserLog.vue"; import OtherTools from "./pages/OtherTools.vue"; +import { store } from "./store"; type RouteComponent = DefineComponent<{}, {}, any>; @@ -112,12 +113,17 @@ const apply_background = async () => { } }; -// download & onedrive +// download & onedrive & userName onMounted(() => { check_update(false); load_collapse(); + getCurUserName(); }); +const getCurUserName = async () => { + store.userName = await invoke("get_current_user_name"); +}; + // sider const collapsed = ref(true); const load_collapse = async () => { diff --git a/src/pages/MonthlyUserLog.vue b/src/pages/MonthlyUserLog.vue index b643c94..eb40776 100644 --- a/src/pages/MonthlyUserLog.vue +++ b/src/pages/MonthlyUserLog.vue @@ -279,7 +279,7 @@ const select_mb_or_gb = (value: string) => { .day:hover { box-shadow: rgba(127, 231, 196, 0.4) 0 3px, rgba(127, 231, 196, 0.3) 0 6px, rgba(127, 231, 196, 0.2) 0 9px, rgba(127, 231, 196, 0.1) 0 12px, - rgba(127, 231, 196, 0.05) 0 15px; + rgba(127, 231, 196, 0.05) 0 15px, rgba(127, 231, 196, 0.4) 0px 0px 50px 1px; } .my-card { diff --git a/src/store.ts b/src/store.ts index a7e203d..ae7e6fc 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,27 +1,18 @@ import { invoke } from "@tauri-apps/api/core"; import { reactive } from "vue"; -const getCurUserName = async (): Promise => { - return await invoke("get_current_user_name"); -}; - const setCurUserName = async () => { await invoke("set_current_user_name", { userName: store.userName }); }; -async function initializeStore() { - const userName = await getCurUserName(); - return reactive({ - userName, - setUserName(userName: string) { - this.userName = userName; - setCurUserName(); - }, - clearUserName() { - this.userName = ""; - setCurUserName(); - }, - }); -} - -export const store = await initializeStore(); +export const store = reactive({ + userName: "", + setUserName(userName: string) { + this.userName = userName; + setCurUserName(); + }, + clearUserName() { + this.userName = ""; + setCurUserName(); + }, +});