Step F2:项目列表 & 当前项目上下文

This commit is contained in:
Cheng Zhou
2025-12-16 20:31:20 +08:00
parent 78d13d077c
commit cc54d80b3a
19 changed files with 239 additions and 24 deletions
+3
View File
@@ -3,6 +3,7 @@ import { ref } from "vue";
import { login as apiLogin, fetchMe } from "../api/auth";
import { setToken, clearToken, getToken } from "../utils/auth";
import type { UserInfo } from "../types/api";
import { useStudyStore } from "./study";
export const useAuthStore = defineStore("auth", () => {
const token = ref<string | null>(getToken());
@@ -31,6 +32,8 @@ export const useAuthStore = defineStore("auth", () => {
token.value = null;
user.value = null;
clearToken();
const studyStore = useStudyStore();
studyStore.clearCurrentStudy();
};
return {