Commit b71cf568 authored by 赵然's avatar 赵然

Merge branch 'zr' into develop

parents aa75e8dc 4c0cfd3d
...@@ -55,6 +55,7 @@ public class Authorization { ...@@ -55,6 +55,7 @@ public class Authorization {
private static Map<String,String> hdCookies; private static Map<String,String> hdCookies;
private static Map<String,String> hdCookiesMabo; private static Map<String,String> hdCookiesMabo;
private static Map<String,String> hdCookiesSaas; private static Map<String,String> hdCookiesSaas;
private static Map<String,Map> hdCookiesSaasByApp = new ConcurrentHashMap<>();
private static Map<String,Map> hdCookiesCommon = new ConcurrentHashMap<>(); private static Map<String,Map> hdCookiesCommon = new ConcurrentHashMap<>();
private static Map<String,String> openbsCookies; private static Map<String,String> openbsCookies;
private Map<String,String> ssoCookies =null; private Map<String,String> ssoCookies =null;
...@@ -247,7 +248,9 @@ public class Authorization { ...@@ -247,7 +248,9 @@ public class Authorization {
} }
public Map hdLoginSaas(String appId){ public Map hdLoginSaas(String appId){
int i=10;
Map<String,String> hdCookies = hdCookiesSaasByApp.get(appId);
while((hdCookies==null||hdCookies.size()==0)&&i>0) {
Response token=this.hdGetToken(); Response token=this.hdGetToken();
String url = PROTOCOL + hdHost + hdLoginPath; String url = PROTOCOL + hdHost + hdLoginPath;
Map<String,String> cookies=token.getCookies(); Map<String,String> cookies=token.getCookies();
...@@ -257,12 +260,17 @@ public class Authorization { ...@@ -257,12 +260,17 @@ public class Authorization {
paras.put("redirect", "/redirectApp"); paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true"); paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url); Response response = given().cookies(cookies).params(paras).post(url);
Map<String,String> hdCookiesSaasByApp=new HashMap<>(response.getCookies()); hdCookies=new HashMap<>(response.getCookies());
//取消安全校验 //取消安全校验
hdCookiesSaasByApp.remove("csrf_token"); hdCookies.remove("csrf_token");
hdCookiesSaasByApp.put("appId",appId); hdCookies.put("appId",appId);
return hdCookiesSaasByApp; hdCookies.put("duibaAppId",appId);
hdCookiesSaasByApp.put(appId,hdCookies);
i--;
}
return hdCookies;
} }
//密码为duibaduiba123 //密码为duibaduiba123
public Map hdLoginCommon(String email){ public Map hdLoginCommon(String email){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment