Forráskód Böngészése

feat: pc端打开时自动跳转

任一存 1 éve
szülő
commit
b45551de4f
4 módosított fájl, 10 hozzáadás és 8 törlés
  1. 2 1
      .env.dev
  2. 2 1
      .env.mytest
  3. 2 1
      .env.prod
  4. 4 5
      src/main.js

+ 2 - 1
.env.dev

@@ -1,4 +1,5 @@
 VUE_APP_CLI_MODE=dev
 NODE_ENV=development
 PUBLIC_PATH=/
-VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_PC_URL="https://culture.4dage.com/NanjingMuseumWuJinZangPc/index.html#/"

+ 2 - 1
.env.mytest

@@ -1,4 +1,5 @@
 VUE_APP_CLI_MODE=test
 NODE_ENV=production
 PUBLIC_PATH=./
-VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_PC_URL="../NanjingMuseumWuJinZangPC/index.html#/"

+ 2 - 1
.env.prod

@@ -1,4 +1,5 @@
 VUE_APP_CLI_MODE=prod
 NODE_ENV=production
 PUBLIC_PATH=./
-VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_DEPLOY_ORIGIN=
+VUE_APP_PC_URL="../wjz/index.html"

+ 4 - 5
src/main.js

@@ -54,11 +54,10 @@ if (uaInfo.browser && uaInfo.browser.name === 'Safari') {
 if (uaInfo.device.type === 'mobile') {
   app.provide('$isMobile', true)
 } else if (process.env.NODE_ENV === 'production') {
-  // window.location.href = './mobile.html'
-  const appDom = document.getElementById('app')
-  appDom.style.maxWidth = '100%'
-  window.location.href = './index.html#/pc'
-
+  window.location.assign(process.env.VUE_APP_PC_URL)
+  // const appDom = document.getElementById('app')
+  // appDom.style.maxWidth = '100%'
+  // window.location.href = './index.html#/pc'
 }
 // } else {
 //   window.location.href = './mobile.html'