新增系统通知实时通知给连接的客户端

This commit is contained in:
不做码农
2022-03-01 14:04:21 +08:00
parent 06b81d5f5e
commit 267469dc55
11 changed files with 148 additions and 38 deletions

View File

@@ -1,10 +1,14 @@
const state = {
onlineNum: 0
onlineNum: 0,
noticeList: []
}
const mutations = {
SET_ONLINEUSER_NUM: (state, num) => {
state.onlineNum = num
},
SET_NOTICE_list: (state, data) => {
state.noticeList = data;
}
}
const actions = {
@@ -12,6 +16,10 @@ const actions = {
changeOnlineNum({ commit }, data) {
commit('SET_ONLINEUSER_NUM', data)
},
// 更新系统通知
getNoticeList({ commit }, data) {
commit('SET_NOTICE_list', data)
}
}
export default {