diff --git a/server/info/internal/logic/addressdefaultlogic.go b/server/info/internal/logic/addressdefaultlogic.go index 6df93f27..90a798ab 100644 --- a/server/info/internal/logic/addressdefaultlogic.go +++ b/server/info/internal/logic/addressdefaultlogic.go @@ -55,6 +55,7 @@ func (l *AddressDefaultLogic) AddressDefault(req *types.AddressDefaultRequest, u } return resp.SetStatus(basic.CodeOK, map[string]any{ + "address_id": req.AddressId, "address_list": addresses, }) // 返回成功并返回地址ID } diff --git a/server/info/internal/logic/addressupdatelogic.go b/server/info/internal/logic/addressupdatelogic.go index d6ef1953..e70d377b 100644 --- a/server/info/internal/logic/addressupdatelogic.go +++ b/server/info/internal/logic/addressupdatelogic.go @@ -70,9 +70,7 @@ func (l *AddressUpdateLogic) AddressUpdate(req *types.AddressRequest, userinfo * return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error()) } - if req.IsDefault > 0 { - l.svcCtx.AllModels.FsAddress.SettingUserDefaultAddress(l.ctx, userinfo.UserId, address.AddressId, req.IsDefault) - } + l.svcCtx.AllModels.FsAddress.SettingUserDefaultAddress(l.ctx, userinfo.UserId, address.AddressId, req.IsDefault) addresses, err := l.svcCtx.AllModels.FsAddress.GetUserAllAddress(l.ctx, userinfo.UserId) if err != nil {