chore: upgrade dependencies and secure passwords

This commit is contained in:
2026-08-10 12:53:23 +08:00
parent 1a1fa521c0
commit 581a503883
53 changed files with 298 additions and 143 deletions

View File

@@ -6,7 +6,9 @@ import (
"bsm/full/module/ec/mall/internal/impl"
"bsm/full/module/ec/mall/internal/models"
"bsm/full/module/ec/mall/internal/password"
pb "bsm/full/module/ec/mall/pb"
"git.apinb.com/bsm-sdk/core/errcode"
"git.apinb.com/bsm-sdk/core/printer"
"git.apinb.com/bsm-sdk/core/service"
@@ -26,16 +28,18 @@ func Create(ctx context.Context, in *pb.StaffItem) (reply *pb.IdentityStatusRepl
return nil, errcode.ErrInvalidArgument
}
salt := utils.RandomString(8)
passwordHash, err := password.Hash(in.GetPassword())
if err != nil {
return nil, err
}
data := models.MallStaff{
Name: in.Name,
Account: in.Account,
Password: utils.Md5(in.Password + salt),
Password: passwordHash,
Profile: in.Profile,
Phone: in.Phone,
Email: in.Email,
Avatar: in.Avatar,
Salt: salt,
Role: "staff",
Std_IICUDS: types.Std_IICUDS{Status: 1},
}