From 5eb15ae3a14cc8c85bb5dbad2c26548cf4abae75 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 20 May 2024 18:12:22 +0800 Subject: [PATCH 1/2] by Robin at 20240520 --- app/mix/service/utilservice.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 592b45c1..38e11d3b 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -685,6 +685,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 From 62ae8742bad8e16b38810797a19fd01f02b148f8 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Mon, 20 May 2024 18:16:17 +0800 Subject: [PATCH 2/2] by Robin at 20240520 --- app/mix/service/utilservice.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 38e11d3b..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