From 8eb7546c609233f93e12daed8e653ee084eb8a89 Mon Sep 17 00:00:00 2001 From: significative <163999932+significative@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:16:08 +0800 Subject: [PATCH] session --- .../src/store/module/user.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teaching_integration_platform_template/src/store/module/user.ts b/teaching_integration_platform_template/src/store/module/user.ts index c2932c6..32c07d7 100644 --- a/teaching_integration_platform_template/src/store/module/user.ts +++ b/teaching_integration_platform_template/src/store/module/user.ts @@ -4,7 +4,7 @@ import { ref, reactive } from 'vue' const userStore = defineStore('userStore', () => { const userInfo = reactive({}) const isLogin = ref(false) - const token = ref(localStorage.getItem('TOKEN') || '') + const token = ref(sessionStorage.getItem('TOKEN') || '') const verifyToken = () => { } const clearUserInfo = () => { Object.keys(userInfo).forEach(function (prop) { @@ -13,7 +13,7 @@ const userStore = defineStore('userStore', () => { } const setToken = (data: string) => { token.value = data - localStorage.setItem('TOKEN', data) + sessionStorage.setItem('TOKEN', data) } const setUserInfo = async () => { try {