Files
ccdi/docs/reports/implementation/2026-05-11-user-password-strong-validation.md

30 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 用户修改密码强密码校验实施记录
## 保存路径检查
- 本次为功能修改实施记录,保存路径确认使用 `docs/reports/implementation/`
## 修改内容
- 后端新增 `PasswordStrengthUtils`,统一校验强密码规则。
- 个人中心修改密码接口 `/system/user/profile/updatePwd` 在旧密码正确后,校验新密码必须满足强密码要求,再校验新旧密码不能相同。
- 前端个人中心“修改密码”表单同步强密码校验提示,提交前拦截弱密码。
- 新增后端单元测试覆盖强密码通过、缺少字符类型、长度不合规、空白与非法字符等场景。
## 强密码规则
- 长度为 8 到 20 位。
- 必须同时包含大写字母、小写字母、数字和特殊字符。
- 不能包含空格或字符:`< > " ' \ |`
## 影响范围
- 影响用户个人中心修改密码功能。
- 不调整登录、注册、管理员新增用户、管理员重置密码等其他密码入口。
## 验证情况
- `mvn -pl ruoyi-admin -am -Dtest=PasswordStrengthUtilsTest -Dsurefire.failIfNoSpecifiedTests=false test`通过3 个强密码规则用例全部成功。
- `source ~/.nvm/nvm.sh && cd ruoyi-ui && nvm use && node -v && npm run build:prod`通过Node 版本为 `v14.21.3`;构建仅保留既有 asset size / entrypoint size 警告。
- 真实页面验证:登录 `http://localhost:9528/user/profile`,进入“修改密码”,输入新密码 `Abc12345` 后点击保存,页面展示强密码校验提示并拦截提交。