实时在线用户功能

This commit is contained in:
橙子
2022-10-03 17:04:59 +08:00
parent e963a4051f
commit 3943536485
25 changed files with 528 additions and 33 deletions

View File

@@ -0,0 +1,20 @@
const socketStore = defineStore(
'socket',
{
state: () => ({
onlineNum: 1
}),
actions: {
// 获取在线总数
getOnlineNum() {
return this.onlineNum;
},
// 设置在线总数
setOnlineNum(value) {
this.onlineNum = value;
}
}
})
export default socketStore