fix: 修复消息通知websocket的连接问题

This commit is contained in:
2023-05-10 15:49:52 +08:00
parent 5e308a87df
commit 1aa8203011
9 changed files with 19 additions and 11 deletions

View File

@@ -4,7 +4,6 @@ window.g = {
},
prod: {
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
}
}

View File

@@ -76,6 +76,9 @@ export default {
Doc,
TopNav
},
created() {
this.initWebSocket()
},
data() {
return {
Avatar: Avatar,
@@ -106,9 +109,6 @@ export default {
}
}
},
created() {
this.initWebSocket()
},
methods: {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')

View File

@@ -7,7 +7,7 @@
<div style="margin: 5px" v-loading="loading">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="d.label" :name="d.value" v-for="d in dict.notice_type" :key="d.id">
<el-empty v-show="notReadMsgList[d.value-1].length == 0" description="暂无信息" ></el-empty>
<el-empty v-if="notReadMsgList && notReadMsgList[d.value-1] && notReadMsgList[d.value-1].length === 0" description="暂无信息" ></el-empty>
<div v-for="o in notReadMsgList[d.value-1]" :key="o.notice_id">
<a href="javascript:" @click="showMessage(o)">
<el-row @click="showMessage">
@@ -52,6 +52,9 @@ export default {
notReadMsgList: []
}
},
beforeMount() {
this.getMessage()
},
methods: {
/**
* 打开列表页