Authored by ping

update

... ... @@ -56,8 +56,8 @@ public class ActivateUnionRest {
String agent = request.getHeader("user-agent");
log.info("addMonitor user-agent={}", agent);
String[] arr = agent.split(";");
if (StringUtils.isEmpty(vo.getTd()) && StringUtils.isNotEmpty(agent)) {
String[] arr = agent.split(";");
for (String str : arr) {
if (str.indexOf("OS/iOS") >= 0) {
String version = str.substring(str.indexOf("OS/iOS") + 6);
... ... @@ -68,6 +68,14 @@ public class ActivateUnionRest {
}
}
if (StringUtils.isNotEmpty(vo.getTd()) && vo.getTd().split("_").length == 2 && arr.length > 4) {
//对客户端没有传入宽高,处理
String s = arr[4];
String w = s.substring(s.indexOf("/") + 1, s.indexOf("*"));
String h = s.substring(s.indexOf("*") + 1);
vo.setTd(w + "_" + h + "_" + vo.getTd());
}
ActivateUnionRequestBO bo = new ActivateUnionRequestBO();
BeanUtils.copyProperties(vo, bo);
... ...