This commit is contained in:
2025-11-12 20:20:12 +08:00
parent a5add3dd73
commit e6a1a1037e
3 changed files with 21 additions and 15 deletions
+5 -4
View File
@@ -6,7 +6,7 @@ import { ref, computed } from "vue";
export const useUserStore = defineStore("user", () => {
// 状态 (State)
const userInfo = ref(null);
const token = ref("");
const cookieValue = ref("");
const isLoggedIn = ref(false);
const logout = () => {
@@ -15,13 +15,14 @@ export const useUserStore = defineStore("user", () => {
const login = () => {
isLoggedIn.value = true;
};
const loginUpdata = () => {
isLoggedIn.value = true;
const loginUpdata = (cookie) => {
console.log(cookie)
cookieValue.value=cookie.value
};
return {
userInfo,
token,
cookieValue,
isLoggedIn,
logout,
login,