|
@@ -191,14 +191,15 @@ export default {
|
|
const that = this;
|
|
const that = this;
|
|
// 开定时器轮询未读消息接口(写在全局vuex里比较好)
|
|
// 开定时器轮询未读消息接口(写在全局vuex里比较好)
|
|
// that.initNotice();
|
|
// that.initNotice();
|
|
- // that.tcMessage();
|
|
|
|
|
|
+ that.tcMessage();
|
|
this.intivalId = setInterval(function () {
|
|
this.intivalId = setInterval(function () {
|
|
that.tcMessage();
|
|
that.tcMessage();
|
|
}, 5000);
|
|
}, 5000);
|
|
// this.timer = setInterval(function () {
|
|
// this.timer = setInterval(function () {
|
|
// that.initNotice();
|
|
// that.initNotice();
|
|
// }, 3000);
|
|
// }, 3000);
|
|
- this.initWebSocket();
|
|
|
|
|
|
+ // 长链接
|
|
|
|
+ // this.initWebSocket();
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.userInfo = JSON.parse(localStorage.getItem("supply_user"));
|
|
this.userInfo = JSON.parse(localStorage.getItem("supply_user"));
|
|
@@ -246,22 +247,23 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
async tcMessage() {
|
|
async tcMessage() {
|
|
- let data = {
|
|
|
|
- type: 'RebateOrderMsg',
|
|
|
|
- params: {
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.websocketSend(JSON.stringify(data))
|
|
|
|
- // let res = await getRebateOrderMsg();
|
|
|
|
- // if (res.data.hasMessage) {
|
|
|
|
- // this.$notify.info({
|
|
|
|
- // title: "消息",
|
|
|
|
- // message: res.data.messages,
|
|
|
|
- // position: "bottom-right",
|
|
|
|
- // duration: 4000,
|
|
|
|
- // showClose: false,
|
|
|
|
- // });
|
|
|
|
|
|
+ // 长链接
|
|
|
|
+ // let data = {
|
|
|
|
+ // type: 'RebateOrderMsg',
|
|
|
|
+ // params: {
|
|
|
|
+ // }
|
|
// }
|
|
// }
|
|
|
|
+ // this.websocketSend(JSON.stringify(data))
|
|
|
|
+ let res = await getRebateOrderMsg();
|
|
|
|
+ if (res.data.hasMessage) {
|
|
|
|
+ this.$notify.info({
|
|
|
|
+ title: "消息",
|
|
|
|
+ message: res.data.messages,
|
|
|
|
+ position: "bottom-right",
|
|
|
|
+ duration: 4000,
|
|
|
|
+ showClose: false,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
goNotice() {
|
|
goNotice() {
|
|
this.$router.push("/notice/index");
|
|
this.$router.push("/notice/index");
|