fix(user-secret): 白名单「获取当前 IP」改走服务端回显,第三方回显只作兜底

无影云桌面等受限网络里 myip.ipip.net 不可达,页面却能正常调自家接口,
导致青果白名单拿不到本机出口 IP。新增 /api/user-secrets/client-ip
回显服务端看到的来源 IP(XFF 逐跳取首个公网地址),前端优先用它,
失败再退回第三方回显。
This commit is contained in:
2026-10-30 17:07:32 +08:00
parent 1c0cc350be
commit c7b035dce9
10 changed files with 184 additions and 6 deletions
+2 -1
View File
@@ -320,7 +320,8 @@ test('test_endpoints_frozen_snapshot', () => {
"migrate": "/api/user-secrets/migrate",
"proxyBalance": "/api/user-secrets/proxy-balance",
"proxyPlan": "/api/user-secrets/proxy-plan",
"proxyWhitelist": "/api/user-secrets/proxy-whitelist"
"proxyWhitelist": "/api/user-secrets/proxy-whitelist",
"clientIp": "/api/user-secrets/client-ip"
},
"costGuard": {
"status": "/api/user/cost-guard/status",