|
@@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
@Slf4j
|
|
|
public class RedirectUtil {
|
|
|
- public static String redirect(String param, boolean wrapper, HttpServletRequest request) {
|
|
|
+ public static String redirect(String param, boolean wrapper, HttpServletRequest request,HttpServletResponse response) {
|
|
|
JSONObject sql_json = JSON.parseObject(param);
|
|
|
String code = sql_json.getString("code");
|
|
|
ConfigRedirect ConfigRedirect = Constant.ConfigRedirectMap.get(code);
|
|
@@ -34,7 +34,7 @@ public class RedirectUtil {
|
|
|
String resultString;
|
|
|
try {
|
|
|
Map<String, String> otherMap = new ConcurrentHashMap<String, String>();
|
|
|
- Object result = RedirectUtil.redirectInner(ConfigRedirect, sql_json, otherMap,request);
|
|
|
+ Object result = RedirectUtil.redirectInner(ConfigRedirect, sql_json, otherMap,request,response);
|
|
|
if (wrapper) {
|
|
|
JSONObject resultJSON = new JSONObject();
|
|
|
resultJSON.put("Result", "success");
|
|
@@ -64,7 +64,7 @@ public class RedirectUtil {
|
|
|
return resultString;
|
|
|
}
|
|
|
|
|
|
- public static Object redirectInner(ConfigRedirect ConfigRedirect, JSONObject sql_json, Map<String, String> otherMap,HttpServletRequest request) throws Exception {
|
|
|
+ public static Object redirectInner(ConfigRedirect ConfigRedirect, JSONObject sql_json, Map<String, String> otherMap,HttpServletRequest request,HttpServletResponse response) throws Exception {
|
|
|
String resultString;
|
|
|
String url = ConfigRedirect.url;
|
|
|
String url_ori = url;
|
|
@@ -106,10 +106,17 @@ public class RedirectUtil {
|
|
|
}
|
|
|
//这里添加日志,重试手动,并设置成短链接
|
|
|
try {
|
|
|
- resultString = HttpClientUtil.instance("redirect").post(url, postString, null, ConfigRedirect.headerMap,null,request);
|
|
|
+ if(url.contains("login"))
|
|
|
+ {
|
|
|
+ resultString = HttpClientUtil.instance("redirect").post(url, postString, null, ConfigRedirect.headerMap,response,request);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ resultString = HttpClientUtil.instance("redirect").post(url, postString, null, ConfigRedirect.headerMap,null,request);
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
log.error("redirect异常", e);
|
|
|
- resultString = HttpClientUtil.instance("redirect").post(url, postString, null, ConfigRedirect.headerMap,null,request);
|
|
|
+ resultString = HttpClientUtil.instance("redirect").post(url, postString, null, ConfigRedirect.headerMap,response,request);
|
|
|
}
|
|
|
}
|
|
|
Object result;
|