diff --git a/lms/nladmin-ui/src/layout/components/Navbar.vue b/lms/nladmin-ui/src/layout/components/Navbar.vue index fa087ec..a3bc05f 100644 --- a/lms/nladmin-ui/src/layout/components/Navbar.vue +++ b/lms/nladmin-ui/src/layout/components/Navbar.vue @@ -47,7 +47,7 @@ - + {{ language }} @@ -95,7 +95,6 @@ export default { }, created() { this.setLang(localStorage.getItem('lang')) - this.initWebSocket() }, computed: { ...mapGetters([ @@ -154,35 +153,6 @@ export default { this.$store.dispatch('LogOut').then(() => { location.reload() }) - }, - initWebSocket() { - // const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'messageInfo' - const wsUri = window.g.prod.VUE_APP_BASE_API.replace('http', 'ws') + '/webSocket/' + 'messageInfo' - this.websock = new WebSocket(wsUri) - this.websock.onerror = this.webSocketOnError - this.websock.onmessage = this.webSocketOnMessage - }, - webSocketOnError(e) { - this.$notify({ - title: this.$t('common.Tip14'), - type: 'error', - duration: 0 - }) - }, - webSocketOnMessage(e) { - const data = JSON.parse(e.data) - if (data.msgType === 'INFO') { - console.log('data', data) - this.$bus.emit(data.msg.data, data.msg.msgType) - } else if (data.msgType === 'ERROR') { - this.$notify({ - title: '', - message: data.msg, - dangerouslyUseHTMLString: true, - type: 'error', - duration: 0 - }) - } } } }