新增在线用户显示

This commit is contained in:
不做码农
2022-05-15 09:24:09 +08:00
parent 89b96a367e
commit b524672b05
4 changed files with 32 additions and 11 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ const getters = {
defaultRoutes: state => state.permission.defaultRoutes,
sidebarRouters: state => state.permission.sidebarRouters,
onlineUserNum: state => state.socket.onlineNum,
noticeList: state => state.socket.noticeList
noticeList: state => state.socket.noticeList,
onlineUsers: state => state.socket.onlineUsers
}
export default getters
+7
View File
@@ -1,5 +1,6 @@
const state = {
onlineNum: 0,
onlineUsers: [],
noticeList: []
}
const mutations = {
@@ -8,6 +9,9 @@ const mutations = {
},
SET_NOTICE_list: (state, data) => {
state.noticeList = data;
},
SET_ONLINE_USERS: (state, data) => {
state.onlineUsers = data;
}
}
@@ -19,6 +23,9 @@ const actions = {
// 更新系统通知
getNoticeList({ commit }, data) {
commit('SET_NOTICE_list', data)
},
getOnlineUsers({ commit }, data) {
commit('SET_ONLINE_USERS', data)
}
}