️ 监听数据,响应式更新 #99

This commit is contained in:
目棃
2024-03-12 20:41:23 +08:00
parent 351c86589e
commit ec4480e386
2 changed files with 24 additions and 10 deletions

View File

@@ -19,7 +19,7 @@
import { event, window as windowTauri } from "@tauri-apps/api";
import type { UnlistenFn } from "@tauri-apps/api/helpers/event";
import { storeToRefs } from "pinia";
import { onMounted, onUnmounted, ref } from "vue";
import { onMounted, onUnmounted, ref, watch } from "vue";
import TGSqlite from "../../plugins/Sqlite";
import { useAppStore } from "../../store/modules/app";
@@ -58,6 +58,12 @@ onMounted(() => {
}
});
watch(userStore.briefInfo, (v) => {
if (v && v.nickname) {
userInfo.value = v;
}
});
async function toWebLogin(): Promise<void> {
const confirm = await showConfirm({
title: "请在子窗口中完成登录操作",
@@ -218,7 +224,6 @@ async function getTokenWeb(cookie: string): Promise<void> {
text: "登录成功!",
color: "success",
});
console.log("cookieUser", cookieUser);
}
async function refreshUser() {