|
|
|
@ -4,7 +4,7 @@ import { ref, reactive } from 'vue' |
|
|
|
|
const userStore = defineStore('userStore', () => { |
|
|
|
|
const userInfo = reactive<any>({}) |
|
|
|
|
const isLogin = ref(false) |
|
|
|
|
const token = ref(sessionStorage.getItem('TOKEN') || '') |
|
|
|
|
const token = ref(localStorage.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
|
|
|
|
|
sessionStorage.setItem('TOKEN', data) |
|
|
|
|
localStorage.setItem('TOKEN', data) |
|
|
|
|
} |
|
|
|
|
const setUserInfo = async () => { |
|
|
|
|
try { |
|
|
|
|