|
|
@@ -30,8 +30,8 @@ class AgentContextService
|
|
|
// 优先读取 CDN/网关在边缘完成的 IP 归属地;没有时保留空值,避免登录依赖外部接口。
|
|
|
return [
|
|
|
'country' => mb_substr((string) ($request->header('CF-IPCountry') ?: $request->header('X-IP-Country', '')), 0, 128),
|
|
|
- 'region' => mb_substr((string) $request->header('X-IP-Region', ''), 0, 128),
|
|
|
- 'city' => mb_substr((string) $request->header('X-IP-City', ''), 0, 128),
|
|
|
+ 'region' => mb_substr((string) ($request->header('CF-Region') ?: $request->header('X-IP-Region', '')), 0, 128),
|
|
|
+ 'city' => mb_substr((string) ($request->header('CF-IPCity') ?: $request->header('X-IP-City', '')), 0, 128),
|
|
|
];
|
|
|
}
|
|
|
}
|