🐛 修复 ck 无法刷新问题

This commit is contained in:
BTMuli
2023-05-21 18:56:06 +08:00
parent 3dd24bf983
commit c63ff84827
2 changed files with 5 additions and 1 deletions

View File

@@ -12,11 +12,13 @@ import TPosition from "../components/t-position.vue";
import TCalendar from "../components/t-calendar.vue";
// store
import { useHomeStore } from "../store/modules/home";
import { useUserStore } from "../store/modules/user";
// utils
import TGSqlite from "../utils/TGSqlite";
// store
const homeStore = useHomeStore();
const userStore = useUserStore();
// loading
const loading = ref(true as boolean);
@@ -42,6 +44,8 @@ function readLoading (): void {
}
onMounted(async () => {
const ck = await TGSqlite.getCookie();
userStore.initCookie(ck);
loadingTitle.value = "正在检测数据完整性";
const isOK = await TGSqlite.check();
if (!isOK) {

View File

@@ -32,7 +32,7 @@ export const useUserStore = defineStore(
return cookie.value[key] || "";
}
async function initCookie (ck: Record<string, string>): Promise<void> {
function initCookie (ck: Record<string, string>): void {
if (cookie.value !== ck) {
cookie.value = ck;
}