From e65826445fc4c2a8f1f9d8de426480124ca0b10f Mon Sep 17 00:00:00 2001 From: ypsdf1 Date: Fri, 20 Nov 2026 00:52:25 +0800 Subject: [PATCH] =?UTF-8?q?125=E7=BB=AD15l-6=EF=BC=9Atoken=E7=9B=B4?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E7=AD=BE=E7=AB=A0=E6=98=BE=E5=BC=8F=E4=BC=A0?= =?UTF-8?q?player+=E8=B7=B3=E8=BD=AC=E4=B8=8D=E8=A2=AB=E7=AD=BE=E7=AB=A0?= =?UTF-8?q?=E9=98=BB=E5=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/login.php b/login.php index 3bc46ac..e17a68f 100644 --- a/login.php +++ b/login.php @@ -488,10 +488,12 @@ require_once __DIR__ . '/captcha_guard.php'; } // 勾选时同步写签章(PHP rules_ack + 回执文件) + // ★ 125 续15l-6:加可选 player 形参。token 直进路没有 #playerName 输入框, + // 原先从输入框取值恒为空 → 签章没写;现在 token 路显式传 player,密码/邮箱路走输入框。 let AG_MARKED = false; - async function fireAgreementMark() { + async function fireAgreementMark(playerArg) { if (AG_MARKED) return; - const player = document.getElementById('playerName')?.value?.trim() || ''; + const player = playerArg || document.getElementById('playerName')?.value?.trim() || ''; if (!player) return; AG_MARKED = true; try { @@ -538,6 +540,8 @@ require_once __DIR__ . '/captcha_guard.php'; doTokenLogin(); // ===== 未签玩家:勾选门放行后点「进入 Web 端」完成跳转 ===== + // ★ 125 续15l-6:签章显式传 player(token 路无 #playerName 输入框), + // 且跳转不再被 fireAgreementMark 的 fetch 阻塞——先跳转,签章后台补写(幂等)。 function enterWeb(player) { // 二次校验协议门(防止用户没真正勾选就点按钮) if (AG.need && !AG.already) { @@ -546,7 +550,6 @@ require_once __DIR__ . '/captcha_guard.php'; return; } } - fireAgreementMark(); statusBox.className = 'status-box success'; statusBox.innerHTML = '✅ 已签署用户协议!

欢迎, ' + player + '
正在跳转到玩家商城...'; fetch('./api/sync.php?action=web_access_check', { @@ -554,9 +557,11 @@ require_once __DIR__ . '/captcha_guard.php'; headers: {'Content-Type': 'application/json'}, body: JSON.stringify({web_token: TOKEN, access_action: 'view'}) }).catch(() => {}); + // ★ 跳转立即执行(300ms 让 UI 先刷新),签章后台补写,绝不阻塞跳转 setTimeout(() => { window.location.href = 'player.php?login=' + encodeURIComponent(player) + '&token=' + encodeURIComponent(TOKEN); - }, 500); + }, 300); + fireAgreementMark(player); // 后台补写签章(token 路显式传 player) } // ===== Token验证 ===== @@ -602,8 +607,8 @@ require_once __DIR__ . '/captcha_guard.php'; actionsDiv.innerHTML = ''; return; } - // ★ 已签 / 无协议 → 无感登录:直接跳转(fireAgreementMark 幂等,未签才补写) - fireAgreementMark(); + // ★ 已签 / 无协议 → 无感登录:直接跳转(fireAgreementMark 幂等,未签才补写;显式传 player) + fireAgreementMark(player); // ★ Token验证成功 → 直接跳转到player.php(跳过密码,token本身即身份证明) statusBox.className = 'status-box success';