|
|
@@ -202,22 +202,16 @@
|
|
|
return this.noticeCount;
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ noticeCount() {
|
|
|
+ this.$store.dispatch('user/setMenuBadge', {
|
|
|
+ path: '/page-wt/message',
|
|
|
+ value: this.noticeCount,
|
|
|
+ color: 'danger'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
- // [1, 2].forEach((item) => {
|
|
|
- // setTimeout(()=>{
|
|
|
- // this.$notify({
|
|
|
- // title: '提示',
|
|
|
- // message: '消息消息',
|
|
|
- // position: 'bottom-right',
|
|
|
- // duration: 0,
|
|
|
- // onClose: (a) => {
|
|
|
- // console.log(item);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },500)
|
|
|
-
|
|
|
- // });
|
|
|
-
|
|
|
if (getToken()) {
|
|
|
console.log(window);
|
|
|
let url =
|
|
|
@@ -228,11 +222,6 @@
|
|
|
let socket = new WebSocket(url);
|
|
|
socket.onmessage = (event) => {
|
|
|
this.noticeCount = event.data * 1 || 0;
|
|
|
- this.$store.dispatch('user/setMenuBadge', {
|
|
|
- path: '/page-wt/message',
|
|
|
- value: this.noticeCount,
|
|
|
- color: 'danger'
|
|
|
- });
|
|
|
if (this.noticeCount) {
|
|
|
getUnreadNotice().then((res) => {
|
|
|
this.visibleModal = false;
|