fix: detect shopee accounts login page
This commit is contained in:
+14
@@ -1073,3 +1073,17 @@
|
||||
- 边界:只处理 `open_product()` 内部打开失败导致的残留 tab;进入编辑页后的更新失败仍按原设计保留现场,成功提交后的关闭仍受 ⑤ `close_success_tab` 控制。
|
||||
- 测试:`tests/test_editor_login.py` 增加自动新建 tab 商品失效时关闭、复用 tab 商品失效时不关闭的覆盖。
|
||||
- 验证:`python -m unittest discover -s tests -p "test_editor_login.py"` 通过(36 tests)。
|
||||
|
||||
## 【2026-07-02】文档 · T-103b 登录检测补充识别 Shopee accounts 登录页
|
||||
- 需求:打开商品详情页或卖家中心时,未登录账号可能跳转到 `https://accounts.shopee.tw/seller/login...`。④「检测登录」以及①/③执行前账号预检应明确把该 URL 判为未登录,不能依赖模糊规则或误判为普通无 Cookie。
|
||||
- 方案:新增 T-103b。登录页 URL marker 显式加入 `accounts.shopee.tw/seller/login` / Shopee accounts 域名下 `/seller/login`;`login_status()` 返回 `logged_in=false/reason=LOGIN_PAGE/url=<实际URL>`;④状态列显示“未登录”,①/③预检继续阻断并引导去④。
|
||||
- 边界:不自动登录、不填密码、不绕过验证码;只增强登录页识别和测试覆盖,不改 CDP 商品页、上传、提交逻辑。
|
||||
- 文档:同步 `docs/02-requirements.md`、`docs/04-architecture.md`、`docs/routes.md`、`docs/api.md`、`docs/06-tasks.md`、`docs/current-state.md`;当前下一个可领取任务改为 T-103b。
|
||||
- 验证:文档-only 更新,未运行单元测试。
|
||||
|
||||
## 【2026-07-02】T-103b 完成 · 登录检测补充识别 Shopee accounts 登录页
|
||||
- 代码:`app/editor.py` 的 `LOGIN_PATH_MARKERS` 显式加入 `accounts.shopee.tw/seller/login`,`_is_login_url()` 增加 `accounts.shopee.*` 域名且路径以 `/seller/login` 开头的判断。
|
||||
- 行为:`login_status()` 遇到 `https://accounts.shopee.tw/seller/login...` 立即返回 `logged_in=false/reason=LOGIN_PAGE/url=<实际URL>`,④状态列会显示未登录,①/③预检继续阻断并引导去④。
|
||||
- 边界:不自动登录、不填密码、不绕过验证码;未改商品页、上传、提交逻辑。
|
||||
- 测试:`tests/test_editor_login.py` 增加真实 accounts 登录 URL 覆盖。
|
||||
- 验证:`python -m unittest discover -s tests -p "test_editor_login.py"` 通过(37 tests)。
|
||||
|
||||
Reference in New Issue
Block a user