R84 R86 收口用户开通界面与自动化回归
这个提交包含在:
@@ -117,3 +117,116 @@ R70 初次试运行暂停项已在 2026-04-28 的 R71 定向修复后关闭。
|
||||
- `paymentBatches` 复核路由仍拦截 maker 自审;低风险批次维持 `finance_mgr` 复核、`finance` 执行的边界。
|
||||
- 失败路径单测确认不会错误归档已绑定发票,也不会误入 ERP / 通知 follow-up。
|
||||
- `PaymentBatchesPage` 与 `ApOperationsPage` 没有新增越权入口,按钮仍按 `payment.batch.manage` 与 `risk.review.manage` 分离。
|
||||
|
||||
## R79 公网部署只读巡检
|
||||
|
||||
- 巡检时间:`2026-05-04 13:04 - 13:16 CST`
|
||||
- 公网地址:`https://oa.hyinda.com`
|
||||
- 服务器:`118.89.77.218`
|
||||
- SSH 结论:`deploy` / `root` 可免密登录;`shunli` 当前不可免密登录。
|
||||
- 反向代理:`caddy` active,`/etc/caddy/Caddyfile` 已包含 `oa.hyinda.com -> reverse_proxy 127.0.0.1:3000`。
|
||||
- 部署目录:`/opt/hyb-oa-trialrun`
|
||||
- 部署形态:远端目录不是 git 工作树;当前推荐从本地执行 `deploy/trialrun/deploy.sh`,通过 `rsync` 同步。
|
||||
- 容器编排:服务器当前使用 `docker-compose 1.29.2`,不是 `docker compose`。
|
||||
- 公网探活:
|
||||
- `https://oa.hyinda.com/ready`:`HTTP/2 200`
|
||||
- `https://oa.hyinda.com`:`HTTP/2 200`
|
||||
- 当前公网 `.env`:
|
||||
- `APP_ORIGIN=https://oa.hyinda.com`
|
||||
- `COOKIE_SECURE=true`
|
||||
- `PUBLIC_SECURITY_HARDENING_ENABLED=true`
|
||||
- `WECOM_ENABLED=false`
|
||||
- `WECOM_ENTRY_ENABLED=false`
|
||||
- `WECOM_OAUTH_ENABLED=false`
|
||||
- `OCR_PROVIDER=mock`
|
||||
- 当前公网数据库只读核查:
|
||||
- `workspace_settings.profile = small_team_internal`
|
||||
- `portal_home_v1 = force_on`
|
||||
- `announcements_v1 = force_off`
|
||||
- `global_search_v1 = force_off`
|
||||
- `wecom_entry_v1 = force_off`
|
||||
- 远端 smoke 结果:
|
||||
- `smoke-external-deps.js`:通过,但其通过前提是“企微入口未启用 + OCR 使用 mock provider”。
|
||||
- `smoke-trialrun-runtime.js`:失败,当前阻塞点为 `announcements_v1 => enabled=false reason=flag_force_off envEnabled=true`。
|
||||
- 结论:
|
||||
- 公网 HTTPS 与容器服务本身已通。
|
||||
- 当前还不能把公网部署态视为“外部试运行闭环完成”。
|
||||
- 下一步最小阻塞清单是:独立 smoke 账号、企微后台配置、以及公网 feature flag 基线修正后重跑 live smoke。
|
||||
|
||||
## R80 企微公网启用与只读验收
|
||||
|
||||
- 执行时间:`2026-05-04 16:47 - 17:03 CST`
|
||||
- 服务器动作:
|
||||
- 已把企微校验文件挂到 `https://oa.hyinda.com/WW_verify_StBYfdlboMaIoRRE.txt`
|
||||
- 已在远端 `/opt/hyb-oa-trialrun/deploy/trialrun/.env` 启用:
|
||||
- `WECOM_ENABLED=true`
|
||||
- `WECOM_ENTRY_ENABLED=true`
|
||||
- `WECOM_OAUTH_ENABLED=true`
|
||||
- `WECOM_CORP_ID` / `WECOM_AGENT_ID` / `WECOM_AGENT_SECRET`
|
||||
- `WECOM_REDIRECT_URI=https://oa.hyinda.com/api/auth/wecom/callback`
|
||||
- `WECOM_ALLOWED_RETURN_HOSTS=oa.hyinda.com`
|
||||
- 已把数据库 `wecom_entry_v1` 从 `force_off` 调整为 `inherit`
|
||||
- 已使用 `docker-compose -f deploy/trialrun/docker-compose.yml --env-file deploy/trialrun/.env up -d --no-deps --force-recreate server` 重建公网 server 容器
|
||||
- curl 验证结果:
|
||||
- `GET /api/auth/wecom/config`:`status=ready`、`entryEnabled=true`、`oauthEnabled=true`
|
||||
- `GET /api/auth/wecom/login?returnTo=%2Fportal`:`HTTP 302`
|
||||
- `Location` 已包含:
|
||||
- `appid=ww6b98ab55e5e8d341`
|
||||
- `agentid=1000002`
|
||||
- `redirect_uri=https://oa.hyinda.com/api/auth/wecom/callback`
|
||||
- Playwright 只读验证:
|
||||
- 登录页已展示“使用企业微信进入工作台”
|
||||
- 浏览器实际请求 `/api/auth/wecom/config` 返回 `200`
|
||||
- 点击按钮后,页面跳转到 `open.weixin.qq.com/...#wechat_redirect`
|
||||
- 桌面浏览器页面提示“请在企业微信客户端打开链接”,符合企微 OAuth 预期
|
||||
- 截图产物:`output/playwright/2026-05-04-wecom-login-page.png`
|
||||
- 当前剩余人工动作:
|
||||
- 必须由你本人使用真实企业微信客户端完成首次进入
|
||||
- 若首次回到 `/login?wecom=unbound`,需先用 OA 账号密码登录并在“个人设置”完成绑定
|
||||
- 绑定成功后,再次从企业微信工作台进入 OA,才算真实企微登录闭环完成
|
||||
- 当前结论:
|
||||
- 服务器侧企微入口、OAuth 跳转、域名校验文件、HTTPS 回调地址均已就绪
|
||||
- 自动化已压到浏览器跳转层;剩余未完成项只剩“真实企微客户端首次绑定闭环”
|
||||
|
||||
## R81 企微回调身份诊断部署
|
||||
|
||||
- 时间:`2026-05-04 17:50 - 17:56 CST`
|
||||
- 背景:
|
||||
- 真实手机企业微信进入 OA 时,服务端收到 `/api/auth/wecom/callback` 回调
|
||||
- 当前失败表现为:`AUTH_003 / missing_user_id`
|
||||
- 你已确认当前企微账号是企业内部成员
|
||||
- 本轮动作:
|
||||
- 为 `missing_user_id` 分支补充最小安全诊断日志
|
||||
- 补 1 条单测覆盖“仅有 OpenId、没有 UserId”场景
|
||||
- 本地校验通过后,已重建公网 `server` 容器
|
||||
- 本地验证结果:
|
||||
- `cd server && node --check src/routes/wecomAuth.js`:通过
|
||||
- `cd server && npm test -- tests/unit/routes/wecomAuth.test.js`:`7 passed`
|
||||
- `cd server && npm run prisma:validate`:通过
|
||||
- 远端验证结果:
|
||||
- `https://oa.hyinda.com/ready`:正常
|
||||
- `https://oa.hyinda.com/api/auth/wecom/config`:`status=ready`
|
||||
- `https://oa.hyinda.com/api/auth/wecom/login?returnTo=%2Fportal`:`302` 到企业微信 OAuth
|
||||
- 当前状态:
|
||||
- 服务器已具备取证能力
|
||||
- 待你用手机企业微信再复现 1 次,我再根据日志判断下一步应是“错误提示优化”还是“绑定模型调整”
|
||||
|
||||
## R83-R86 用户开通与首次绑定收口
|
||||
|
||||
- 时间:`2026-05-04 23:36 - 23:58 CST`
|
||||
- 本轮本地实现:
|
||||
- 单个新建用户改为系统自动生成员工号,不再要求管理员手工输入工号。
|
||||
- 单个新建用户改为后端生成一次性口令,并在成功态只展示一次。
|
||||
- 新用户首次登录后继续沿用强制改密闭环。
|
||||
- 企业微信未绑定回退登录时,服务端已保留短时待绑定上下文,并在账号密码登录成功后自动补绑定。
|
||||
- 本轮新增自动化结果:
|
||||
- `cd server && npm test -- tests/unit/routes/auth.login.test.js tests/unit/routes/wecomAuth.test.js tests/unit/routes/users.write.test.js`
|
||||
- `11 passed`
|
||||
- `cd client && E2E_BASE_URL=http://127.0.0.1:3100 npx playwright test tests/e2e/user-onboarding.spec.ts tests/e2e/wecom-first-bind.spec.ts --workers=1 --reporter=list`
|
||||
- `3 passed`
|
||||
- 自动化已验证链路:
|
||||
- 管理员创建用户 -> 系统返回员工号与一次性口令
|
||||
- 新用户首次登录 -> 强制修改密码 -> 进入 Portal
|
||||
- 企业微信未绑定 -> 回退密码登录 -> 继续进入目标页
|
||||
- 仍需真实人工复核:
|
||||
- 将本轮代码部署到目标环境后,用真实手机企业微信完成 1 次首次进入,确认真实 OAuth 回调、cookie 与企业身份环境下也能自动完成首次绑定闭环。
|
||||
|
||||
在新工单中引用
屏蔽一个用户