添加分享房间链接和对战结束返回房间

This commit is contained in:
kron
2026-01-09 11:50:21 +08:00
parent 4aa14c6a4c
commit 71b25144a4
14 changed files with 204 additions and 209 deletions

View File

@@ -2,7 +2,7 @@ import { defineStore } from "pinia";
const defaultUser = {
id: "",
nickName: "游客",
nickName: "",
avatar: "../static/user-icon.png",
trio: 0, // 大于1表示完成了新手引导
lvlName: "",
@@ -50,6 +50,10 @@ export default defineStore("store", {
ringRank: [],
},
online: false,
game: {
roomID: "",
inBattle: false,
},
}),
// 计算属性
@@ -103,6 +107,10 @@ export default defineStore("store", {
this.config.randInfos
);
},
updateGame(inBattle = false, roomID = "") {
this.game.roomID = roomID;
this.game.inBattle = inBattle;
},
},
// 开启数据持久化