YY 2 years ago
parent
commit
e189a8e91d
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/layout/header/notice.vue

+ 7 - 3
src/layout/header/notice.vue

@@ -36,7 +36,8 @@ export default {
     async initWebSocket() {
       const shop_id = _.get(this.user, 'shop._id');
       // const url = `ws://192.168.1.197:12214/dev/point/chat/v1/api/ws`;
-      const url = `ws://broadcast.waityou24.cn/dev/point/chat/v1/api/ws`;
+      // const url = `ws://broadcast.waityou24.cn/dev/point/chat/v1/api/ws`;
+      const url = `ws://broadcast.waityou24.cn/point/chat/v1/api/ws`;
       const ws = new WS(url, shop_id, (res) => {
         console.log(res);
         if (res.data != 'connect success') this.onMessage(res.data);
@@ -59,8 +60,11 @@ export default {
         });
         this.getNotRead();
       } else if (type === 'chat') {
-        if (this.$route.path === '/selfShop/message') this.setMessage(data);
-        else {
+        if (this.$route.path === '/selfShop/message') {
+          console.log('1');
+          this.setMessage(data);
+        } else {
+          console.log(2);
           this.instance = this.$notify({
             title: '新消息',
             message: '有顾客进行咨询,请及时回复!',