门户登录

master
significative 2 months ago
parent 8a141fa19d
commit 2888905c41
  1. 4
      teaching_integration_platform_template/src/store/module/user.ts

@ -4,7 +4,7 @@ import { ref, reactive } from 'vue'
const userStore = defineStore('userStore', () => { const userStore = defineStore('userStore', () => {
const userInfo = reactive<any>({}) const userInfo = reactive<any>({})
const isLogin = ref(false) const isLogin = ref(false)
const token = ref(sessionStorage.getItem('TOKEN') || '') const token = ref(localStorage.getItem('TOKEN') || '')
const verifyToken = () => { } const verifyToken = () => { }
const clearUserInfo = () => { const clearUserInfo = () => {
Object.keys(userInfo).forEach(function (prop) { Object.keys(userInfo).forEach(function (prop) {
@ -13,7 +13,7 @@ const userStore = defineStore('userStore', () => {
} }
const setToken = (data: string) => { const setToken = (data: string) => {
token.value = data token.value = data
sessionStorage.setItem('TOKEN', data) localStorage.setItem('TOKEN', data)
} }
const setUserInfo = async () => { const setUserInfo = async () => {
try { try {

Loading…
Cancel
Save