Update store paths and add persistence plugin

This commit is contained in:
wangqiao
2025-08-26 16:25:58 +08:00
parent e021ac1e05
commit 4263a0a235
27 changed files with 61 additions and 31 deletions

View File

@ -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 === '个人中心') {