Conversation
- 新增「账号发现」:以官方 auth 登录历史为主(含凭据、可补录)、storage/settings 残留为辅,比对账号库列出「本机还有哪些账号没入册」,附凭据文件数 / 备份时间 / 凭据是否可续期 - 新增「一键补录」:用该 uid 最新的 auth 历史备份构造账号记录写进账号库 (写入前备份 accounts.json) - 账号页顶部提示条:只在存在未入册账号时出现,补录后自动刷新列表 - 复用 `auth_file::imported_account_from_root`(仅提可见性为 pub(crate),无行为变化) - 本地新增代码集中在 `api_local.rs` / `commands_local.rs`, `api.rs` / `main.rs` / `lib.rs` 各只加接线行
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
切号工具只能看到「已经导入过」的账号。可本机真正登录过、凭据还留着的账号,如果当初没导入,用户根本不知道它存在 —— 想切也切不过去。这个 PR 补上发现与补录。
做了什么
账号发现(只读,不动任何数据)
扫官方 auth 登录历史(主)与 settings / storage / 画像缓存残留(辅),跟账号库比对,列出「本机还有哪些账号没入册」,每个账号给出:凭据备份文件数、最近备份时间、access / refresh 凭据过期时间、是否可补录。
一键补录
拿该 uid 最新的 auth 历史备份构造账号记录写进账号库;写入前先备份
accounts.json。入口
账号页顶部提示条 —— 只在真有未入册账号时出现,补录后自动刷新列表;没有时不占位。
实现说明
crates/wb-switch-core/src/modules/discover.rsapi_local.rs/commands_local.rs(新文件,合并零冲突);api.rs/main.rs/lib.rs各只加接线行,避免在上游热点文件里堆代码auth_file.rs的imported_account_from_root由fn提为pub(crate) fn供复用,无行为变化验证
cargo test -p wb-switch-core:336 passed / 9 failed —— 9 个失败与上游 main 完全同一批(对照见下),非本 PR 引入cargo check -p wb-switch-core -p wb-switch-server:通过node node_modules/typescript/bin/tsc --noEmit:通过9 个失败的对照说明(Windows 环境)
本机 Windows 下,纯净上游 main 跑出与本分支完全相同的 9 个失败项(main 334 passed、本分支 336 passed,失败项逐一相同),涉及
variant/export_import/codebuddy_cli/session/token_stats/rate_limit_hook的平台相关断言,属上游既有问题(Linux / macOS 不受影响)。本分支未触碰这些文件。同一批失败已在 #62 中修复(路径断言按
/归一化 +SetFileTime用可写句柄 + 兼容实现而非屏蔽测试)。