Commit Graph
8 Commits
Author SHA1 Message Date
key a07bbcca07 fix: support authenticated video citation playback 2026-08-02 22:04:09 +08:00
adminandClaude Opus 5 27f4cdac70 fix(mobile): abort uni.request when the platform timeout does not fire
Some uni-app platforms ignore the `timeout` option, leaving the returned
promise pending forever and hanging the calling page with no error path.

Drive the deadline locally: keep a single-shot `finish` guard so success,
failure and timeout can only settle once, and on timeout call `task.abort()`
before rejecting so the in-flight request is released instead of leaking.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-25 23:56:56 +08:00
admin 0f5c2e8667 feat(mobile-app): prepare native app packaging 2026-07-23 14:40:23 +08:00
adminandClaude Fable 5 dfd82e1886 fix: unify all aihr collations, stop silent logout on biz 403, enable knowledge apps
线上现象:「问」页语音提问报 401(请求不带 token),用户观察为
「点了几个页面后登录状态失效」。

根因链(逐环生产验证):
1. 问师傅 /api/knowledge/query 对真实登录返回业务 403
   「当前登录端未启用知识问答应用」——生产 aihr_knowledge_app 为空表,
   多租户知识平台的应用注册/空间绑定/角色授权从未在生产配置(P1 遗留)。
2. 前端 readPayload 把 403 也视为认证失败并 clearAuth() —— 业务 403
   触发静默登出,localStorage token 被清。
3. 之后语音 ASR 请求裸奔 -> 401「未能读取到有效 token」。

同期回归:凌晨对 aihr_practice_assignment.ext_party_id 的单列 collation
热修复,使其与 aihr_practice_session(仍 0900_ai_ci)的 JOIN 反向失配,
/practice/mistakes 500。

修复:
- backend/script/sql/update/aihr_20260718_unify_all_collations_mysql8.sql:
  47 张 aihr 表全部 CONVERT 到运行时基准 collation(生产=general_ci),
  终结 collation 打地鼠;本地验证后已在生产执行
  (schema 备份 /opt/wygj/backups/aihr-schema-before-unify-20260718041407.sql),
  13 项移动端接口回归全 200(含 mistakes)。
- api.ts/auth.ts:本地登录态仅在真正 401(HTTP 或业务码)时清除,并经
  redirectToLoginForAuthLoss 记住当前页自动回登录(2s 防抖,登录页内不跳);
  业务 403(权限拒绝,如录音归属/知识空间)只报错不登出;
  authenticatedFileUrl 同步收紧(403 不再清登录态)。
- 生产数据配置(幂等 INSERT,业务范围保守):
  · aihr_knowledge_app 注册 yc_admin(pc)/yc_mobile(app) SESSION 应用
  · yc_mobile 绑定 SOP 域 5 库(1001/1002/1003/1201/1202),
    employee/supervisor ROLE READ;yc_admin 绑定全部 13 库,
    hr_operator/superadmin MANAGE
  · 财务/销售/行政等大库(1004-1010)暂仅管理端,待业务确认再放开

生产验证:
- 问师傅 query 200,真实回答+引用「投诉处理 SOP v1.0」
- E2E:登录后全 tab 浏览+语音+文字提问,token 全程稳定(storage 打桩零触发)
- 无效 token 点语音提问 -> 自动回登录页(原为死胡同 toast)
- H5 已发布(备份 h5-before-20260718042238)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 04:24:45 +08:00
adminandClaude Fable 5 0ec0e585f7 fix(mobile): distinguish auth failure from HR mismatch on position sync page
问题:登录态失效(token 冻结/无效,后端返 401)时,同步岗位页把认证错误
误显示成「人力系统中未匹配到当前手机号的在职岗位,请联系 HR」,员工被
困在该页无路可退。

修复:
- api.ts: 新增 ApiError(statusCode/bizCode) 类型化错误与 isAuthApiError,
  readPayload/parsePayloadText/XHR 路径统一抛出带状态码的错误,消息不变
- position.ts: fetchOrgPositionResult 返回四态判别结果
  matched/unmatched/unauthorized/error;hydratePositionFromOrg 行为不变
- position/index.vue: 按四态分支处理——
  · unauthorized -> 清除登录态并自动回登录页(保留 redirect)
  · error -> 提示「网络异常…请重试」,保留重试按钮
  · unmatched -> 才显示联系 HR 文案
  并新增「退出重新登录」链接(确认弹窗后清登录态回登录页),
  避免任何异常场景下用户被困无退出路径

验证(构建产物 + 生产 API,Playwright 五场景全过,截图见
.data/visual-audit-20260718/position-fix/):
S1 固定码真实登录->今日页(保洁岗匹配) S2 无效token->自动回登录
S3 断网->网络异常提示留在本页 S4 有效token->自动通过
S5 退出链接->确认->回登录且登录态已清

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 03:39:20 +08:00
admin c66fc4e4b0 feat(mobile): finish employee app page polish 2026-07-11 18:59:30 +08:00
admin 7de6fa9969 fix(mobile): load supervisor review audio with auth 2026-07-09 16:19:11 +08:00
admin 678543e8a5 feat(aihr): complete uni-app role workflows 2026-07-09 10:42:20 +08:00