29 lines
680 B
TypeScript
29 lines
680 B
TypeScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import ElementPlus from 'element-plus'
|
|
import 'element-plus/dist/index.css'
|
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
import { useAuthStore } from './stores/auth'
|
|
|
|
import './assets/styles/index.css'
|
|
|
|
const app = createApp(App)
|
|
const pinia = createPinia()
|
|
|
|
app.use(pinia)
|
|
app.use(router)
|
|
app.use(ElementPlus, {
|
|
locale: zhCn,
|
|
})
|
|
|
|
// 初始化认证状态
|
|
const authStore = useAuthStore()
|
|
authStore.initAuth().then(() => {
|
|
app.mount('#app')
|
|
}).catch((error) => {
|
|
console.error('初始化认证状态失败:', error)
|
|
app.mount('#app')
|
|
}) |