library-picturebook-activity/lesingle-creation-frontend/src/main.ts
En 98e9ad1d28 feat(前端): 测试环境登录框支持自动填充测试账号
通过 VITE_AUTO_FILL_TEST 环境变量控制,在 .env.test 中启用,
使测试环境构建后登录框也能自动填充测试账号,方便测试人员使用。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 17:03:22 +08:00

34 lines
892 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { createApp } from "vue"
import { createPinia } from "pinia"
import Antd from "ant-design-vue"
import "ant-design-vue/dist/reset.css"
import "./styles/global.scss"
import "./styles/theme.scss"
import "./assets/styles/aicreate.scss"
import App from "./App.vue"
import router from "./router"
import { useAuthStore } from "./stores/auth"
import { setupPermissionDirective } from "./directives/permission"
// 引入 dayjs 及其中文语言包
import dayjs from "dayjs"
import "dayjs/locale/zh-cn"
dayjs.locale("zh-cn")
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(Antd)
// 注册权限指令
setupPermissionDirective(app)
// 应用启动时初始化认证状态
// 如果有 token自动获取用户信息
const authStore = useAuthStore()
authStore.initAuth().finally(() => {
app.mount("#app")
})