From 09b6a8fb815523bf2568daae72abc8c2b51572db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 19 Dec 2023 20:26:36 +0800 Subject: [PATCH] =?UTF-8?q?:bug:fix=20=E6=8E=A7=E5=88=B6=E5=8F=B0=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Vue/src/store/modules/socket.js | 15 ++++++++------- ZR.Vue/src/utils/signalR.js | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ZR.Vue/src/store/modules/socket.js b/ZR.Vue/src/store/modules/socket.js index 5d9935b..a2d12db 100644 --- a/ZR.Vue/src/store/modules/socket.js +++ b/ZR.Vue/src/store/modules/socket.js @@ -1,14 +1,15 @@ const state = { onlineNum: 0, - noticeList: [] + noticeList: [], } const mutations = { - SET_ONLINEUSER_NUM: (state, num) => { + SET_ONLINEUSER_NUM: (state, data) => { + const { onlineClients, num } = data state.onlineNum = num }, SET_NOTICE_list: (state, data) => { - state.noticeList = data; - } + state.noticeList = data + }, } const actions = { @@ -19,12 +20,12 @@ const actions = { // 更新系统通知 getNoticeList({ commit }, data) { commit('SET_NOTICE_list', data) - } + }, } export default { namespaced: true, state, mutations, - actions -} \ No newline at end of file + actions, +} diff --git a/ZR.Vue/src/utils/signalR.js b/ZR.Vue/src/utils/signalR.js index 505e7be..72770d8 100644 --- a/ZR.Vue/src/utils/signalR.js +++ b/ZR.Vue/src/utils/signalR.js @@ -82,5 +82,7 @@ export default { store.dispatch('socket/getNoticeList', data.data) } }) + connection.on('onlineInfo', () => {}) + connection.on('connId', () => {}) }, }