Browse Source

各处url适配生产环境

任一存 2 năm trước cách đây
mục cha
commit
96caa96e13
3 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 2 2
      .env
  2. 1 1
      public/static/js/Hot.js
  3. 2 1
      src/main.js

+ 2 - 2
.env

@@ -1,3 +1,3 @@
 VUE_APP_STATIC_DIR=static
 VUE_APP_STATIC_DIR=static
-VUE_APP_API_URL_PREFIX=https://haidebao.4dage.com
-VUE_APP_PC_URL=/web/index.html#/?m=KJ-nsyFEd392Wt_1
+VUE_APP_API_URL_PREFIX=
+VUE_APP_SCENE_CODE=KJ-nsyFEd392Wt_1

+ 1 - 1
public/static/js/Hot.js

@@ -37,7 +37,7 @@ window.initHot = function (model) {
   var getCommonHotspotUrl = function (link) {
   var getCommonHotspotUrl = function (link) {
     var querySectionInLink = link.split('?')[1]
     var querySectionInLink = link.split('?')[1]
     var langParam = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : ""
     var langParam = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : ""
-    // return `http://192.168.20.16:8080/#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
+    // return `http://192.168.20.16:8081/#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
     return `/webMHotEn/index.html#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
     return `/webMHotEn/index.html#/${browser.isMobile() ? 'mobile' : 'web'}/?${querySectionInLink}&time=${randomTime().getTime()}&id=${window.number}${langParam}`
   }
   }
   var removeSrcPostMark = function (url) {//去除texture.load时自动加上的'?'
   var removeSrcPostMark = function (url) {//去除texture.load时自动加上的'?'

+ 2 - 1
src/main.js

@@ -13,7 +13,8 @@ import "@/assets/style/my-reset.css"
 
 
 console.log('v0410.1517')
 console.log('v0410.1517')
 if (!browser.mobile) {
 if (!browser.mobile) {
-  location.replace(process.env.VUE_APP_PC_URL)
+  let firstUrlDir = location.href.split('/')[1]
+  location.replace(`/${firstUrlDir.substring(0, firstUrlDir.length - 1)}/index.html#/?m=${process.env.VUE_APP_SCENE_CODE}`)
 }
 }
 
 
 Vue.use(Viewer, {
 Vue.use(Viewer, {