19 Commits

Author SHA1 Message Date
liufumingren
640ce501cb feat(user): 新增账号用户名/密码修改与自定义密码标记
- wms_account 新增 is_custom_password(TINYINT(1) NOT NULL DEFAULT 0),同步模型与迁移 20261025135000;开发库、生产库均已执行

- user.getAccountInfo 返回 is_custom_password,仍不返回 password_hash/salt/last_login_ip

- 新增 user.updateUsername:仅改当前账号,服务端重名校验并排除自己,重名返回 409,更新后清理用户缓存

- 新增 user.changePassword:is_custom_password=0 时旧密码可不传,修改后置 1;再次修改必须校验旧密码;已排除操作日志避免明文密码落库

- 单测覆盖 getAccountInfo/updateUsername/changePassword,20 通过;同步 AI_METHOD_ROUTING

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-27 03:08:51 +08:00
liufumingren
0e7545bd9a feat(user): 新增 user.getAccountInfo 账号级信息查询
- 新增 user.getAccountInfo:仅查询当前登录账号的 wms_account 信息

- 白名单返回 id/username/real_name/phone/email/status/last_login_at/created_at/updated_at,排除 password_hash、salt、last_login_ip

- 未登录返回 401,账号不存在返回 404;不接收账号ID,避免越权查询

- 同步 methods/system.json(0.3.304 → 0.3.305)、变更记录、AI_METHOD_ROUTING 与方法文档库表

- 新增单测 test/app/service/systemMethods/user.getAccountInfo.test.js(5 通过)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-25 13:43:26 +08:00
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