Compare commits

...

5 Commits

  1. 4
      .env.production
  2. 10
      src/main.ts

@ -3,5 +3,5 @@ NODE_ENV = 'development'
VITE_APP_TITLE = '高赛通单项目'
VITE_APP_BASE_API = http://115.190.99.211:18086/jeecg-boot
# VITE_APP_BASE_API = 'http://127.0.0.1:8080'
VITE_APP_PC_URL = http://localhost:18085/jeecg-boot
VITE_APP_MOBILE_URL = http://localhost:18085/jeecg-boot
VITE_APP_PC_URL = http://115.190.99.211:803/#/home
VITE_APP_MOBILE_URL = http://115.190.99.211:8030

@ -50,6 +50,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
// 初始化主题
const useThemeStore = themeStore()
useThemeStore.initTheme()
const ua = navigator.userAgent.toLowerCase()
const isMobile = /iphone|android|ipad|mobile/.test(ua)
@ -58,12 +59,11 @@ const mobileHost = new URL(import.meta.env.VITE_APP_MOBILE_URL).host
const pcHost = new URL(import.meta.env.VITE_APP_PC_URL).host
if (isMobile && currentHost !== mobileHost) {
console.log('手机端,跳转到移动站')
location.href = import.meta.env.VITE_APP_MOBILE_URL
console.log('手机端,跳转到移动站')
location.href = import.meta.env.VITE_APP_MOBILE_URL
} else if (!isMobile && currentHost !== pcHost) {
console.log('电脑端,跳转到 PC 站')
location.href = import.meta.env.VITE_APP_PC_URL
console.log('电脑端,跳转到 PC 站')
location.href = import.meta.env.VITE_APP_PC_URL
}

Loading…
Cancel
Save