kongdeqiang
2026-10-12 ed3c2513c35efa714f2a377aef55501dd15d1fec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { createApp } from 'vue'
import { createPinia } from 'pinia'
 
import App from './App.vue'
import router from './router'
import { useAuthStore } from './stores/authStore'
import './styles/global.css'
 
const app = createApp(App)
const pinia = createPinia()
 
app.use(pinia)
app.use(router)
 
// 在挂载前恢复本地保存的登录状态。
// 必须早于 router 首次导航,否则刷新页面时路由守卫会误判为未登录并把用户踢回登录页。
useAuthStore().restore()
 
app.mount('#app')