|
@ -47,30 +47,30 @@ public class PostFilter extends ZuulFilter {
|
|
|
}
|
|
|
InputStream stream = RequestContext.getCurrentContext().getResponseDataStream();
|
|
|
try {
|
|
|
byte[] bytes;
|
|
|
if(RequestContext.getCurrentContext().getResponseGZipped()){
|
|
|
GZIPInputStream gzipInputStream = null;
|
|
|
gzipInputStream = new GZIPInputStream(stream);
|
|
|
bytes = StreamUtils.copyToByteArray(gzipInputStream);
|
|
|
}else {
|
|
|
bytes = StreamUtils.copyToByteArray(stream);
|
|
|
}
|
|
|
String body = new String(bytes,"UTF8");
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status","200");
|
|
|
object.put("data", AesEncryptUtils.encrypt(body));
|
|
|
if (!(url.contains("/open/noLogin/notify")||
|
|
|
url.contains("/open/noLogin/ylzReceiveNotify")||
|
|
|
url.contains("/open/noLogin/receiveNotify")||
|
|
|
url.contains("/open/noLogin/getSFExpressInfoNew")||
|
|
|
url.contains("/open/noLogin/sfroutepushservice")||
|
|
|
url.contains("/open/noLogin/ylzSettleRecord")||
|
|
|
url.contains("/weixin")||url.contains("/oauth/getSsoPublicKey"))){
|
|
|
RequestContext.getCurrentContext().setResponseBody(object.toJSONString());
|
|
|
}else {
|
|
|
RequestContext.getCurrentContext().setResponseBody(body);
|
|
|
}
|
|
|
logger.info(ctx.getResponseBody()+"");
|
|
|
byte[] bytes;
|
|
|
if(RequestContext.getCurrentContext().getResponseGZipped()){
|
|
|
GZIPInputStream gzipInputStream = null;
|
|
|
gzipInputStream = new GZIPInputStream(stream);
|
|
|
bytes = StreamUtils.copyToByteArray(gzipInputStream);
|
|
|
}else {
|
|
|
bytes = StreamUtils.copyToByteArray(stream);
|
|
|
}
|
|
|
String body = new String(bytes,"UTF8");
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status","200");
|
|
|
object.put("data", AesEncryptUtils.encrypt(body));
|
|
|
if (!(url.contains("/open/noLogin/notify")||
|
|
|
url.contains("/open/noLogin/ylzReceiveNotify")||
|
|
|
url.contains("/open/noLogin/receiveNotify")||
|
|
|
url.contains("/open/noLogin/getSFExpressInfoNew")||
|
|
|
url.contains("/open/noLogin/sfroutepushservice")||
|
|
|
url.contains("/open/noLogin/ylzSettleRecord")||
|
|
|
url.contains("/weixin")||url.contains("/oauth/getSsoPublicKey"))){
|
|
|
RequestContext.getCurrentContext().setResponseBody(object.toJSONString());
|
|
|
}else {
|
|
|
RequestContext.getCurrentContext().setResponseBody(body);
|
|
|
}
|
|
|
logger.info(ctx.getResponseBody()+"");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|