新增signalR连接
This commit is contained in:
22
ZR.Vue/src/store/modules/socket.js
Normal file
22
ZR.Vue/src/store/modules/socket.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const state = {
|
||||
onlineNum: 0
|
||||
}
|
||||
const mutations = {
|
||||
SET_ONLINEUSER_NUM: (state, num) => {
|
||||
state.onlineNum = num
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
//更新在线人数
|
||||
changeOnlineNum({ commit }, data) {
|
||||
commit('SET_ONLINEUSER_NUM', data)
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
}
|
||||
Reference in New Issue
Block a user