|
|
@@ -53,7 +53,7 @@ import { messages } from '@/i18n'
|
|
|
import screenfull from 'screenfull'
|
|
|
import UpdatePassword from './main-navbar-update-password'
|
|
|
import { clearLoginInfo } from '@/utils'
|
|
|
-var socket = null
|
|
|
+// var socket = null
|
|
|
export default {
|
|
|
inject: ['refresh'],
|
|
|
data () {
|
|
|
@@ -67,29 +67,29 @@ export default {
|
|
|
UpdatePassword
|
|
|
},
|
|
|
created () {
|
|
|
- var vue = this
|
|
|
- socket = new WebSocket(`${window.SITE_CONFIG['socketURL']}`)
|
|
|
- socket.onopen = function () {}
|
|
|
- socket.onerror = function () {
|
|
|
- vue.$notify.error({
|
|
|
- title: vue.$t('notice.disconnect'),
|
|
|
- message: vue.$t('notice.disconnectMessage')
|
|
|
- })
|
|
|
- }
|
|
|
- socket.onmessage = function (evt) {
|
|
|
- const result = JSON.parse(evt.data)
|
|
|
+ // var vue = this
|
|
|
+ // socket = new WebSocket(`${window.SITE_CONFIG['socketURL']}`)
|
|
|
+ // socket.onopen = function () {}
|
|
|
+ // socket.onerror = function () {
|
|
|
+ // vue.$notify.error({
|
|
|
+ // title: vue.$t('notice.disconnect'),
|
|
|
+ // message: vue.$t('notice.disconnectMessage')
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // socket.onmessage = function (evt) {
|
|
|
+ // const result = JSON.parse(evt.data)
|
|
|
|
|
|
- // 如果是有新文本通知,则提示有新通知
|
|
|
- if (result.type === 0) {
|
|
|
- vue.messageTip = true
|
|
|
- vue.$notify({
|
|
|
- title: vue.$t('notice.new'),
|
|
|
- message: result.msg,
|
|
|
- type: 'info',
|
|
|
- duration: 5000
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ // // 如果是有新文本通知,则提示有新通知
|
|
|
+ // if (result.type === 0) {
|
|
|
+ // vue.messageTip = true
|
|
|
+ // vue.$notify({
|
|
|
+ // title: vue.$t('notice.new'),
|
|
|
+ // message: result.msg,
|
|
|
+ // type: 'info',
|
|
|
+ // duration: 5000
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// 未读通知数
|
|
|
this.getUnReadCount()
|