|
@@ -268,7 +268,9 @@ public class TrackingController {
|
|
|
// 仅 dev/test 环境允许通过 ip 参数覆盖(本地测试用)
|
|
// 仅 dev/test 环境允许通过 ip 参数覆盖(本地测试用)
|
|
|
String ip = allowIpOverride ? params.get("ip") : null;
|
|
String ip = allowIpOverride ? params.get("ip") : null;
|
|
|
device.put("ip", (ip != null && !ip.isBlank()) ? ip : clientIp(request));
|
|
device.put("ip", (ip != null && !ip.isBlank()) ? ip : clientIp(request));
|
|
|
- device.put("ua", AdxClient.BAIDU_USER_AGENT);
|
|
|
|
|
|
|
+ // 优先使用真实设备UA,无则使用默认UA
|
|
|
|
|
+ String ua = firstParam(params, "ua", "user_agent", "useragent");
|
|
|
|
|
+ device.put("ua", (ua != null && !ua.isBlank()) ? ua : AdxClient.BAIDU_USER_AGENT);
|
|
|
device.put("deviceType", 1);
|
|
device.put("deviceType", 1);
|
|
|
int os = baiduOsForPlatform(resolved.platform());
|
|
int os = baiduOsForPlatform(resolved.platform());
|
|
|
if (os != 0) device.put("os", os);
|
|
if (os != 0) device.put("os", os);
|