fix: 第1批 M1、M4~M6 登录密码统一规则与三类导出补列
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
- 七个设置登录密码入口统一 8~12 位、四类字符至少三类(1001/1016),修改密码与建店铺返回字段级提示 - 订单导出末列“操作人”、IoT 卡导出末列“套餐到期时间”、设备导出流量标 MB 并新增“设备合计(GB)” - 历史导出任务按冻结表头识别新旧尾列,行宽不变 - OpenSpec Change fix-august-iteration-export-and-password-hints:10/12,5.3 前端同步与 5.4 测试部署导出验证待完成
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/break/junhong_cmp_fiber/pkg/constants"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/middleware"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/validator"
|
||||
"go.uber.org/zap"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"gorm.io/gorm"
|
||||
@@ -224,6 +225,10 @@ func (s *Service) ChangePassword(ctx context.Context, userID uint, oldPassword,
|
||||
return errors.Wrap(errors.CodeInternalError, err, "查询账号失败")
|
||||
}
|
||||
|
||||
if err := validator.ValidateLoginPassword("新密码", newPassword); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := bcrypt.CompareHashAndPassword([]byte(account.Password), []byte(oldPassword)); err != nil {
|
||||
appErr := errors.New(errors.CodeInvalidOldPassword, "旧密码错误")
|
||||
s.recordSecurityFailure(ctx, account, constants.AuditActionAccountPasswordChanged, "拒绝修改账号密码", constants.AuditResultDenied, "", appErr)
|
||||
|
||||
Reference in New Issue
Block a user