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 {