Browse Source

iframe加载刷新

李文 4 years ago
parent
commit
fd5550a3c4
3 changed files with 5 additions and 3 deletions
  1. 1 1
      public/index.html
  2. 1 1
      src/mock/modules/sys-menu.js
  3. 3 1
      src/views/main/main-content.vue

+ 1 - 1
public/index.html

@@ -39,7 +39,7 @@
   <!-- 开发环境 -->
   <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
     <script>window.SITE_CONFIG['apiURL'] = 'http://124.225.17.80:8156/api-idaas';</script>
-    <!-- <script>window.SITE_CONFIG['apiURL'] = 'http://10.110.35.55:9900/api-idaas';</script> -->
+    <script>window.SITE_CONFIG['apiURL'] = 'http://10.110.35.55:9900/api-idaas';</script>
     <!-- <script>window.SITE_CONFIG['apiURL'] = 'http://172.16.124.90:9900/api-idaas';</script> -->
   <% } %>
   <!-- 集成测试环境 -->

+ 1 - 1
src/mock/modules/sys-menu.js

@@ -672,7 +672,7 @@ var navDataList4 = [
     'name': '网址嵌套',
     'ename': 'webaddress',
     'path': 'webaddress',
-    'url': 'http://localhost:8003',
+    'url': 'http://localhost:8002/#/onemap',
     // 'componentPath': 'modules/demo/all-form-type',
     'children': []
   },

+ 3 - 1
src/views/main/main-content.vue

@@ -1,6 +1,6 @@
 <template>
   <main class="smp-content" :class="{'isIframe':isIframe}">
-    <iframe v-if="isIframe" ref="myIframe" :src="iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
+    <iframe :key="iframeIndex" v-if="isIframe" ref="myIframe" :src="iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
     <router-view v-else />
   </main>
 </template>
@@ -12,12 +12,14 @@ export default {
   data () {
     return {
       iframeURL: this.addParams(this.$route.meta.iframeURL),
+      iframeIndex: 0,
       isIframe: false
     }
   },
   watch: {
     $route () {
       this.iframeURL = this.addParams(this.$route.meta.iframeURL)
+      this.iframeIndex++
       this.initUrl()
     }
   },