| | |
| | | import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' |
| | | pinia.use(piniaPluginPersistedstate) |
| | | |
| | | const app = createApp(App) |
| | | const title = import.meta.env.VITE_APP__TITLE |
| | | app.config.globalProperties.$title = title |
| | | document.title = title |
| | | app.use(fxHeader) |
| | | app.use(i18n) |
| | | app.use(router) |
| | | app.use(pinia) |
| | | app.use(store) |
| | | // 生产环境且为 PC 端时跳转到 PC 站 |
| | | const PC_SITE_URL = 'https://wealthinfrapc.eledrink.com' |
| | | function isPc() { |
| | | if (typeof navigator === 'undefined') return false |
| | | const ua = navigator.userAgent || '' |
| | | const mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i.test(ua) |
| | | return !mobile |
| | | } |
| | | if (import.meta.env.PROD && isPc()) { |
| | | window.location.href = PC_SITE_URL |
| | | } else { |
| | | const app = createApp(App) |
| | | const title = import.meta.env.VITE_APP__TITLE |
| | | app.config.globalProperties.$title = title |
| | | document.title = title |
| | | app.use(fxHeader) |
| | | app.use(i18n) |
| | | app.use(router) |
| | | app.use(pinia) |
| | | app.use(store) |
| | | |
| | | app.mount('#app') |
| | | app.mount('#app') |
| | | } |