From c635d78b479510ebe2556a420948effcd30a0731 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期六, 21 十二月 2024 18:40:43 +0800 Subject: [PATCH] 新建德森项目分支 --- zy-asrs-admin/src/main.js | 90 ++++++++++++++++++++++---------------------- 1 files changed, 45 insertions(+), 45 deletions(-) diff --git a/zy-asrs-admin/src/main.js b/zy-asrs-admin/src/main.js index b3dc4d2..88a3227 100644 --- a/zy-asrs-admin/src/main.js +++ b/zy-asrs-admin/src/main.js @@ -1,45 +1,45 @@ -import './assets/main.css' -import { createApp } from 'vue' -import { createPinia } from 'pinia' -import App from './App.vue' -import router from './router' -import Antd from 'ant-design-vue'; -import 'ant-design-vue/dist/reset.css'; -import { initRouter } from '@/router/index.js' -import { globalState } from './config.js' -import print from 'vue3-print-nb' -import { loadData } from '@/utils/localeUtils.js' - -const app = createApp(App) - -const initToken = async () => { - if (globalState.token == '' || globalState.token == null) { - let token = localStorage.getItem('token') - let user = JSON.parse(localStorage.getItem('user')) - let locale = localStorage.getItem('locale') - globalState.token = token; - globalState.user = user; - if(locale != null) { - globalState.locale = locale; - } - - loadData(globalState.locale) - } -} - -const boot = async () => { - await initToken(); - await initRouter() - - //wait route load - app.use(createPinia()) - app.use(router) - app.use(Antd) - app.use(print) - router.isReady().then((e) => { - app.mount('#app') - }) -} -boot() - - +import './assets/main.css' +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' +import router from './router' +import Antd from 'ant-design-vue'; +import 'ant-design-vue/dist/reset.css'; +import { initRouter } from '@/router/index.js' +import { globalState } from './config.js' +import print from 'vue3-print-nb' +import { loadData } from '@/utils/localeUtils.js' + +const app = createApp(App) + +const initToken = async () => { + if (globalState.token == '' || globalState.token == null) { + let token = localStorage.getItem('token') + let user = JSON.parse(localStorage.getItem('user')) + let locale = localStorage.getItem('locale') + globalState.token = token; + globalState.user = user; + if(locale != null) { + globalState.locale = locale; + } + + loadData(globalState.locale) + } +} + +const boot = async () => { + await initToken(); + await initRouter() + + //wait route load + app.use(createPinia()) + app.use(router) + app.use(Antd) + app.use(print) + router.isReady().then((e) => { + app.mount('#app') + }) +} +boot() + + -- Gitblit v1.9.1