17 Commits

Author SHA1 Message Date
liufumingren
81127b61aa fix(auth): 角色切换按平台维度清理缓存,修复小程序端切换身份不生效
changeRole 写库用的是请求头 platform 原值(如 miniProgram),但清缓存调用的却是
clearUserCache(userId)(不带平台),其内部只清 web/pda/mini/app/workerstation/workstation
这几个硬编码平台;miniProgram/wx 等取值不在清单内,且 Redis key 大小写敏感,
user:info:{accountId}:{platform} 会残留切换前的旧身份,紧随其后的 findById 命中 5 分钟旧缓存,
导致签发的 token current_role_id 与返回的 data.user 都是切换前的角色
(实测出现 current_role_id=34 + current_store_id=1000000 这种自相矛盾的 token)。

修复:clearUserCache(user.id, platformCode),并同步清理
platform_active:{accountId}:{platformCode}(30 分钟 TTL)。

验证(开发环境 temp/verify-change-role-fix.cjs):注入旧身份缓存后 user.info 返回注入值
→ changeRole 返回 employees_id=33,token 的 current_role_id/current_store_id 自洽
→ 回读缓存已刷新,DB 行保持 33 未被改动。
2026-09-26 18:00:20 +08:00
liufumingren
258232f98d feat(wechat): 微信开放平台第三方平台接入:授权事件回调、加解密、OpenAPI 客户端、oauth 登录态中间层与工牌扫码 2026-09-23 02:46:28 +08:00
liufumingren
99367e5043 1 2026-06-06 05:15:46 +08:00
liufumingren
adb1a16599 1 2026-05-16 23:00:49 +08:00
liufumingren
9845a239e2 1 2026-05-16 02:44:53 +08:00
liufumingren
9b2cc5fc73 fix(receiving): 修复获取收货单时重复定义属性的问题 2026-05-06 01:32:55 +08:00
liufumingren
57f1f44bae feat: sync wms updates 2026-04-09 15:45:14 +08:00
liufumingren
3d824a3a1d chore: sync lint and service fixes 2026-04-09 01:36:49 +08:00
liufumingren
e590808062 feat: update receiving notification and report flow 2026-04-05 21:45:18 +08:00
liufumingren
de9c5c0ab6 Merge branch 'ming' of ssh://192.168.9.101:22/liufumingren/WMS_MAIN into ming 2026-04-05 09:08:09 +08:00
liufumingren
920d201c0e feat: refine setting role/account/permission auth and tests 2026-04-05 09:03:50 +08:00
liufumingren
26af1a7039 feat: refine setting role/account/permission auth and tests 2026-03-31 00:35:53 +08:00
liufumingren
2f838186de chore: sync updates and daylog 2026-03-26 2026-03-25 23:26:10 +08:00
liufumingren
b9e94f1035 chore: 提交当前工作区改动 2026-03-25 18:12:04 +08:00
liufumingren
ab26e1e8e7 chore: 全量提交,包含脚本、文档与配置等最新更改 2026-03-24 23:59:59 +08:00
liufumingren
bbc5891d16 chore: sync workspace changes 2026-03-23 17:10:07 +08:00
63b4536766 chore: initialize wms project 2026-03-16 14:01:22 +08:00