update:新增匹配跳转幂等

This commit is contained in:
2026-07-20 16:46:04 +08:00
parent b15c37cb4a
commit 886faa0007
2 changed files with 25 additions and 11 deletions
+7 -5
View File
@@ -4,10 +4,12 @@ function getMatchId(battleInfo) {
return battleInfo?.matchId || battleInfo?.id || "";
}
function getBattlePageUrl(battleInfo) {
return Number(battleInfo?.mode) <= 3
? "/pages/team-battle/index?fromReturn=1"
: "/pages/melee-battle?fromReturn=1";
function getBattlePageUrl(battleInfo, matchId) {
const page =
Number(battleInfo?.mode) <= 3
? "/pages/team-battle/index"
: "/pages/melee-battle";
return `${page}?fromReturn=1&battleId=${encodeURIComponent(String(matchId))}`;
}
export function takeMatchReturnSnapshot() {
@@ -27,6 +29,6 @@ export async function returnToBattle(battleInfo, navigate) {
}
uni.setStorageSync(MATCH_RETURN_SNAPSHOT_KEY, battleInfo);
await navigate(getBattlePageUrl(battleInfo));
await navigate(getBattlePageUrl(battleInfo, matchId));
return true;
}