From d2a165ada8b478c0cc3c6d04ce67b450e0210e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E5=B7=A5?= Date: Sat, 29 Aug 2026 20:44:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(HEL-243):=20=E5=BD=93=E5=89=8D=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=8F=AF=E7=82=B9=E5=87=BB=E8=BF=94=E5=9B=9E=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=88=87=E6=8D=A2=E6=AD=BB=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当前账号行原先只显示对号、不可点击,单账号时只能关网页。现改为整行继续使用且不重新签发会话,并带回切换前的业务页。 Co-authored-by: Cursor Co-authored-by: multica-agent --- config/architecture-inventory.json | 20 ++-- frontend/login/index.html | 4 +- frontend/login/page.js | 55 +++++++++- frontend/pages.config.js | 2 +- frontend/shared/auth.css | 12 +++ frontend/shared/session.js | 8 +- tests/e2e/login-portal.spec.js | 159 ++++++++++++++++++++++++++++- tests/test_login_portal.py | 13 +++ 8 files changed, 252 insertions(+), 21 deletions(-) diff --git a/config/architecture-inventory.json b/config/architecture-inventory.json index a15d82c..8f33db1 100644 --- a/config/architecture-inventory.json +++ b/config/architecture-inventory.json @@ -553,16 +553,16 @@ "bytes": 13681, "lines": 338 }, + { + "path": "frontend/shared/session.js", + "bytes": 13219, + "lines": 289 + }, { "path": "frontend/shared/dashboard.js", "bytes": 12894, "lines": 274 }, - { - "path": "frontend/shared/session.js", - "bytes": 12848, - "lines": 283 - }, { "path": "backend/features/market/insights_auction_data.py", "bytes": 12829, @@ -673,16 +673,16 @@ "bytes": 5451, "lines": 118 }, + { + "path": "frontend/pages.config.js", + "bytes": 5385, + "lines": 130 + }, { "path": "frontend/pages/market/search.js", "bytes": 5384, "lines": 131 }, - { - "path": "frontend/pages.config.js", - "bytes": 5380, - "lines": 130 - }, { "path": "frontend/pages/auction/page.html", "bytes": 5350, diff --git a/frontend/login/index.html b/frontend/login/index.html index c3d1333..32eaf8e 100644 --- a/frontend/login/index.html +++ b/frontend/login/index.html @@ -21,7 +21,7 @@ - + @@ -90,6 +90,6 @@ - + diff --git a/frontend/login/page.js b/frontend/login/page.js index 9c2617e..23af83b 100644 --- a/frontend/login/page.js +++ b/frontend/login/page.js @@ -77,9 +77,22 @@ return chips.join(""); } + function returnPath() { + const raw = new URLSearchParams(global.location.search).get("next") || ""; + if (!raw) return "/"; + try { + const url = new URL(raw, global.location.origin); + if (url.origin !== global.location.origin) return "/"; + const path = url.pathname || "/"; + if (path === "/login" || path.startsWith("/login/")) return "/"; + return `${path}${url.search}${url.hash}` || "/"; + } catch (_error) { + return "/"; + } + } + function enterApp() { - const next = new URLSearchParams(global.location.search).get("next"); - global.location.replace(next && next.startsWith("/") ? next : "/"); + global.location.replace(returnPath()); } function formMarkup(options) { @@ -120,7 +133,7 @@ "login-account-row", current ? "is-current" : "", confirming ? "is-confirming" : "", - !managing && !current ? "is-switchable" : "", + !managing ? "is-switchable" : "", ].filter(Boolean).join(" "); if (managing && confirming) { return [ @@ -138,11 +151,12 @@ const action = managing ? `` : current - ? '' + ? '' : ""; const switchAttr = !managing && !current ? ` data-switch-id="${account.user_id}"` : ""; + const resumeAttr = !managing && current ? ` data-resume-id="${account.user_id}"` : ""; return [ - `
`, + `
`, ``, '