chore: upgrade dependencies and secure passwords
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"bsm/full/module/ec/market/internal/impl"
|
||||
"bsm/full/module/ec/market/internal/models"
|
||||
"bsm/full/module/ec/market/internal/password"
|
||||
pb "bsm/full/module/ec/market/pb"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
@@ -23,15 +24,17 @@ func Create(ctx context.Context, in *pb.MarketSupplyItem) (reply *pb.IdentitySta
|
||||
if in.GetName() == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
salt := utils.RandomString(8)
|
||||
passwordHash, err := password.Hash(in.GetPassword())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mktModel := &models.MarketSupply{
|
||||
Std_IICUDS: types.Std_IICUDS{Identity: utils.ULID(), Status: 1},
|
||||
Name: in.GetName(),
|
||||
// Avatar: in.GetAvatar(),
|
||||
Account: in.GetAccount(),
|
||||
Phone: in.GetPhone(),
|
||||
Password: utils.Md5(in.Password + salt),
|
||||
Salt: salt,
|
||||
Password: passwordHash,
|
||||
OrgName: in.GetOrgName(),
|
||||
Remark: in.GetRemark(),
|
||||
CommissionRate: in.GetCommissionRate(),
|
||||
|
||||
Reference in New Issue
Block a user