Parcourir la source

im定时器修改

wangdy il y a 8 ans
Parent
commit
6df023c0c5
2 fichiers modifiés avec 11 ajouts et 5 suppressions
  1. 7 2
      components/default/RightBar.vue
  2. 4 3
      nuxt.config.js

+ 7 - 2
components/default/RightBar.vue

@@ -111,8 +111,13 @@
       }
     },
     mounted () {
-      this.getChatCount()
-      setInterval(this.getChatCount(), 10000)
+      this.$nextTick(() => {
+        this.getChatCount()
+        // 刷新统计信息
+        setInterval(() => {
+          this.getChatCount()
+        }, 10000)
+      })
     },
     methods: {
       listenPage: function (p) {

+ 4 - 3
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.60:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://10.10.100.107:8081/platform-b2c/' : 'http://192.168.253.121:8887/b2c-im/')
 
 module.exports = {
   router: {
@@ -97,7 +97,8 @@ module.exports = {
     src: '~plugins/vue-empty.js',
     ssr: false
   }, {
-    src: '~plugins/element-ui.js'
+    src: '~plugins/element-ui.js',
+    ssr: true
   }, {
     src: '~plugins/filters.js',
     ssr: false
@@ -106,5 +107,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/release/**', '/auth/store/**', '/produce/**', '/file**', '/rate/**', '/log/**']
 }