feat: 完成账号桌面快捷方式

- 新增 chrome.create_shortcut 使用 PowerShell WScript.Shell 生成 .lnk

- 快捷方式参数复用 Chrome 启动参数,包含调试端口、allow-origins 和账号 user-data-dir

- 在账号服务层和 Tab④ 增加快捷方式入口,不包含密码或密钥

- 补充 chrome/accounts/gui 测试并同步任务、API、路由、当前状态和进度文档
This commit is contained in:
chengma
2026-06-27 10:38:21 +08:00
parent 598df5f20b
commit 742193607b
11 changed files with 208 additions and 13 deletions
+26
View File
@@ -90,6 +90,32 @@ class AccountsTests(TempDirMixin, unittest.TestCase):
self.assert_removed(temp_dir)
def test_create_shortcut_uses_account_record(self):
with self.make_temp_dir() as temp_dir:
cfg = self.make_config(temp_dir)
account = accounts.create_account("主店", "alias", debug_port=9222, config=cfg)
shortcut_path = os.path.join(temp_dir, "Desktop", "主店.lnk")
with mock.patch(
"app.accounts.chrome.create_shortcut",
return_value=shortcut_path,
) as create_shortcut:
result = accounts.create_shortcut(
"alias",
shortcut_path=shortcut_path,
config=cfg,
)
self.assertEqual(shortcut_path, result)
create_shortcut.assert_called_once_with(
account,
shortcut_path=shortcut_path,
desktop_dir=None,
config=cfg,
)
self.assert_removed(temp_dir)
def test_detect_login_updates_last_login_at_when_logged_in(self):
with self.make_temp_dir() as temp_dir:
cfg = self.make_config(temp_dir)