feat(user): add encryption algorithm and salt fields to User model for migrate

This commit is contained in:
Chang lue Tsen
2025-10-09 13:33:03 -04:00
parent de4386ff68
commit 8562734fde
14 changed files with 20 additions and 7 deletions
@@ -40,6 +40,7 @@ func (l *CreateUserLogic) CreateUser(req *types.CreateUserRequest) error {
pwd := tool.EncodePassWord(req.Password)
newUser := &user.User{
Password: pwd,
Algo: "default",
ReferralPercentage: req.ReferralPercentage,
OnlyFirstPurchase: &req.OnlyFirstPurchase,
ReferCode: req.ReferCode,
@@ -129,6 +129,7 @@ func (l *UpdateUserBasicInfoLogic) UpdateUserBasicInfo(req *types.UpdateUserBasi
return errors.Wrapf(xerr.NewErrCodeMsg(503, "Demo mode does not allow modification of the admin user password"), "UpdateUserBasicInfo failed: cannot update admin user password in demo mode")
}
userInfo.Password = tool.EncodePassWord(req.Password)
userInfo.Algo = "default"
}
err = l.svcCtx.UserModel.Update(l.ctx, userInfo)