Authored by ping

update

... ... @@ -40,6 +40,6 @@ public class UnionConstant {
//iSO系统
iOSServiceList.add("dDServiceImpl");
//iOSServiceList.add("gdtServiceImpl");
iOSServiceList.add("gdtServiceImpl");
}
}
... ...
... ... @@ -56,10 +56,14 @@ public class ActivateUnionRest {
String agent = request.getHeader("user-agent");
log.info("addMonitor user-agent={}", agent);
if (StringUtils.isEmpty(vo.getTd()) && StringUtils.isNotEmpty(agent)) {
if (agent.toLowerCase().indexOf("mac os x") >= 0 || agent.toLowerCase().indexOf("iphone") >= 0) {
String version = agent.substring(agent.indexOf(" OS ") + 4, agent.indexOf(" like"));
vo.setTd("ios_" + version.replaceAll("_", "."));
log.info("activateUnion request={}", vo);
String[] arr = agent.split(";");
for (String str : arr) {
if (str.indexOf("OS/iOS") >= 0) {
String version = str.substring(str.indexOf("OS/iOS") + 6);
vo.setTd("ios_" + version);
log.info("activateUnion request={}", vo);
break;
}
}
}
... ... @@ -73,7 +77,7 @@ public class ActivateUnionRest {
}
bo.setClientIp(RemoteIPInterceptor.getRemoteIP());
//多线程处理
exe.execute(new RunActivate(bo));
exe.execute(new RunActivate(bo, agent));
return new ActiveUnionResponseBO(200, "success");
}
... ... @@ -85,11 +89,13 @@ public class ActivateUnionRest {
public static class RunActivate implements Runnable {
public RunActivate(ActivateUnionRequestBO bo) {
public RunActivate(ActivateUnionRequestBO bo, String agent) {
this.bo = bo;
this.agent = agent;
}
private ActivateUnionRequestBO bo;
private String agent;
@Override
public void run() {
... ... @@ -131,6 +137,14 @@ public class ActivateUnionRest {
public void setBo(ActivateUnionRequestBO bo) {
this.bo = bo;
}
public String getAgent() {
return agent;
}
public void setAgent(String agent) {
this.agent = agent;
}
}
}
... ...
... ... @@ -81,6 +81,11 @@ public class GDTServiceImpl implements MainUnionService {
@Override
public UnionResponseBO activeUnion(ActivateUnionRequestBO request) {
log.info("activateUnion with param is{}", request);
//广点通进行特殊处理
if (request.getAgent().indexOf("YH_Mall_iPhone_C3") < 0) {
log.info("activeUnion not GTD with request={}", request);
return new UnionResponseBO(false, "error");
}
UnionResponseBO response = check(request);
if (!response.getIsSuccess()) {
return response;
... ...
... ... @@ -93,7 +93,7 @@
appid: appid
},
complete: function() {
window.location.href = downUrl;
///window.location.href = downUrl;
}
});
... ...
... ... @@ -94,7 +94,7 @@
appid: appid
},
complete: function() {
window.location.href = downUrl;
//window.location.href = downUrl;
}
});
... ...