From b5fa17e58dcde7f3b6b4587f407080ce70aaac6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Wed, 3 Dec 2025 14:40:03 +0800 Subject: [PATCH] =?UTF-8?q?gateway=E5=88=86=E9=85=8D=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consul/consul.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consul/consul.go b/consul/consul.go index 638ec2f..415a137 100644 --- a/consul/consul.go +++ b/consul/consul.go @@ -58,7 +58,7 @@ func GetInstanceAddr(ctx context.Context, name string) (addr string, err error) return } //优先使用客户端IP获取实例(前后端在同一台机器调试) - addr = getInstanceAddrByIp(ctx, g.RequestFromCtx(ctx).GetRemoteIp(), service) + addr = getInstanceAddrByIp(ctx, g.RequestFromCtx(ctx).GetClientIp(), service) if !g.IsEmpty(addr) { return }