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', () => {}) }, }