diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 592b45c1..87ebb751 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -662,6 +662,15 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err PhoneHash: goproto.String(phoneHash), }, }) + if qmgo.IsDup(err) { + err = _DefaultLogin.OpUpdate(ctx, &loginproto.OpUpdateReq{ + Login: &dbstruct.Login{ + Id: login.Id, + Password: goproto.String(cfg.Password), + PhoneHash: goproto.String(phoneHash + qmgo.NewObjectID().Hex()), + }, + }) + } if err != nil { logger.Error("_DefaultLogin OpUpdate fail, err: %v", err) return err @@ -685,6 +694,20 @@ func (s *Service) utilCancelAccountByMids(ctx *gin.Context, midList []int64) err Status: goproto.Int64(consts.AccountStatus_Cancelled), }, }) + if qmgo.IsDup(err) { + err = _DefaultAccount.OpUpdate(ctx, &accountproto.OpUpdateReq{ + Account: &dbstruct.Account{ + Mid: account.Mid, + Name: goproto.String(cfg.Name), + PhoneHash: goproto.String(phoneHash + qmgo.NewObjectID().Hex()), + MobilePhone: goproto.String(cfg.MobilePhone), + Avatar: &dbstruct.MediaComponent{ + ImageIds: &imageIds, + }, + Status: goproto.Int64(consts.AccountStatus_Cancelled), + }, + }) + } if err != nil { logger.Error("_DefaultAccount OpUpdate fail, err: %v", err) return err