Update store paths and add persistence plugin
This commit is contained in:
@ -68,10 +68,10 @@
|
||||
import type { ProjectDrawStatisticAppRespVO } from '~/api/home/type'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import refreshToken from "~/utils/RefreshToken";
|
||||
import useUserStore from '~/store/user'
|
||||
import useUserStore from '~/stores/user'
|
||||
const userStore = useUserStore()
|
||||
const app = useNuxtApp()
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
active: {
|
||||
type: String,
|
||||
@ -89,8 +89,6 @@
|
||||
|
||||
// 是否登录
|
||||
const isLogin = computed(() => {
|
||||
console.log('userStore.token', refreshToken.getToken());
|
||||
|
||||
return !!userStore.token
|
||||
})
|
||||
|
||||
@ -180,6 +178,7 @@
|
||||
}
|
||||
const handleCommand = (command: string) => {
|
||||
if (command === '退出') {
|
||||
clearNuxtState(['token', 'userInfo'])
|
||||
userStore.logout()
|
||||
userStore.$reset()
|
||||
} else if (command === '个人中心') {
|
||||
|
||||
Reference in New Issue
Block a user