From b31698b9f215ba5edc45cc9912677105eccf2481 Mon Sep 17 00:00:00 2001 From: shaw Date: Thu, 25 Dec 2025 21:58:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E4=BB=A3=E7=90=86ip=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/service/admin_service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/internal/service/admin_service.go b/backend/internal/service/admin_service.go index 964711b7..d676ac8f 100644 --- a/backend/internal/service/admin_service.go +++ b/backend/internal/service/admin_service.go @@ -638,6 +638,7 @@ func (s *adminServiceImpl) UpdateAccount(ctx context.Context, id int64, input *U } if input.ProxyID != nil { account.ProxyID = input.ProxyID + account.Proxy = nil // 清除关联对象,防止 GORM Save 时根据 Proxy.ID 覆盖 ProxyID } // 只在指针非 nil 时更新 Concurrency(支持设置为 0) if input.Concurrency != nil { @@ -662,7 +663,8 @@ func (s *adminServiceImpl) UpdateAccount(ctx context.Context, id int64, input *U } } - return account, nil + // 重新查询以确保返回完整数据(包括正确的 Proxy 关联对象) + return s.accountRepo.GetByID(ctx, id) } // BulkUpdateAccounts updates multiple accounts in one request.