Browse Source

三位文物模型链接配置为可以从本地拿

任一存 2 years ago
parent
commit
7f232246a7
6 changed files with 9 additions and 8 deletions
  1. 2 2
      .env.dev
  2. 3 2
      .env.localdeploy
  3. 1 1
      .env.test
  4. 1 1
      src/main.js
  5. 1 1
      src/views/HomeMobile.vue
  6. 1 1
      src/views/HomeWeb.vue

+ 2 - 2
.env.dev

@@ -1,4 +1,4 @@
-CLI_MODE=dev
+VUE_APP_CLI_MODE=dev
 NODE_ENV=development
 NODE_ENV=development
 PUBLIC_PATH=./
 PUBLIC_PATH=./
-VUE_APP_G_PREFIX=https://super.4dage.com/
+VUE_APP_G_PREFIX=https://super.4dage.com/

+ 3 - 2
.env.localdeploy

@@ -1,4 +1,5 @@
-CLI_MODE=local
+VUE_APP_CLI_MODE=local
 NODE_ENV=production
 NODE_ENV=production
 VUE_APP_PUBLIC_PATH=./
 VUE_APP_PUBLIC_PATH=./
-VUE_APP_G_PREFIX=http://localhost/
+VUE_APP_G_PREFIX=http://localhost/
+VUE_APP_RELIC_MODEL_PATH=http://localhost/culturalrelics/XZHHXS/Model2.html

+ 1 - 1
.env.test

@@ -1,4 +1,4 @@
-CLI_MODE=test
+VUE_APP_CLI_MODE=test
 NODE_ENV=production
 NODE_ENV=production
 PUBLIC_PATH=./
 PUBLIC_PATH=./
 VUE_APP_G_PREFIX=https://super.4dage.com/
 VUE_APP_G_PREFIX=https://super.4dage.com/

+ 1 - 1
src/main.js

@@ -23,7 +23,7 @@ Vue.use(clickOutside)
 
 
 Vue.config.productionTip = false
 Vue.config.productionTip = false
 Vue.prototype.$http = axios
 Vue.prototype.$http = axios
-
+Vue.prototype.$env = process.env
 
 
 new Vue({
 new Vue({
   router,
   router,

+ 1 - 1
src/views/HomeMobile.vue

@@ -73,7 +73,7 @@
           <iframe
           <iframe
             v-for="(item, index) in hotspotData.model"
             v-for="(item, index) in hotspotData.model"
             :key="index"
             :key="index"
-            :src="item"
+            :src="$env.VUE_APP_CLI_MODE === 'local' ? `${$env.VUE_APP_RELIC_MODEL_PATH}?m=${item.split('m=')[1]}` : item"
             frameborder="0"
             frameborder="0"
             class="swiper-slide"
             class="swiper-slide"
           />
           />

+ 1 - 1
src/views/HomeWeb.vue

@@ -147,7 +147,7 @@
             <iframe
             <iframe
               v-for="(item, index) in hotspotData.model"
               v-for="(item, index) in hotspotData.model"
               :key="index"
               :key="index"
-              :src="item"
+              :src="$env.VUE_APP_CLI_MODE === 'local' ? `${$env.VUE_APP_RELIC_MODEL_PATH}?m=${item.split('m=')[1]}` : item"
               frameborder="0"
               frameborder="0"
               class="swiper-slide"
               class="swiper-slide"
             />
             />