fix(HEL-243): 当前账号可点击返回,避免切换死路
当前账号行原先只显示对号、不可点击,单账号时只能关网页。现改为整行继续使用且不重新签发会话,并带回切换前的业务页。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
e29d5115fa
commit
d2a165ada8
@@ -46,9 +46,22 @@ class LoginPortalContractTests(unittest.TestCase):
|
||||
|
||||
def test_portal_keeps_account_switch_and_theme_hooks(self) -> None:
|
||||
self.assertIn("data-switch-id", LOGIN_JS)
|
||||
self.assertIn("data-resume-id", LOGIN_JS)
|
||||
self.assertIn('data-login-action="manage"', LOGIN_JS)
|
||||
self.assertIn('data-login-action="add"', LOGIN_JS)
|
||||
self.assertIn('data-login-action="resume"', LOGIN_JS)
|
||||
self.assertIn("继续使用", LOGIN_JS)
|
||||
self.assertIn("返回复盘", LOGIN_JS)
|
||||
self.assertIn("/api/auth/me", LOGIN_JS)
|
||||
self.assertIn("xiaobaiTheme", LOGIN_JS)
|
||||
self.assertNotIn("内网个人版", LOGIN)
|
||||
self.assertNotIn("192.168.200.11", LOGIN)
|
||||
self.assertNotIn("/api/heaven", LOGIN_JS)
|
||||
|
||||
def test_current_account_row_stays_clickable_without_reswitching(self) -> None:
|
||||
self.assertIn("resumeCurrentAccount", LOGIN_JS)
|
||||
self.assertIn("当前会话已失效,请重新登录", LOGIN_JS)
|
||||
self.assertNotIn("!managing && !current ? \"is-switchable\"", LOGIN_JS)
|
||||
session = (ROOT / "frontend" / "shared" / "session.js").read_text(encoding="utf-8")
|
||||
self.assertIn('params.set("next", next)', session)
|
||||
self.assertIn(".login-account-action", AUTH)
|
||||
|
||||
Reference in New Issue
Block a user