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,22 +248,29 @@ public class Authorization { ...@@ -247,22 +248,29 @@ 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();
String url = PROTOCOL + hdHost + hdLoginPath;
Map<String,String> cookies=token.getCookies();
Map<String, String> paras = new HashMap<>();
paras.put("email", "wxs@duiba.com.cn");
paras.put("password", SecurityUtils.getMD5("dbZcFiIc5yMHcee/o/PJEfyZjug="+from(token.asString()).getString("data.loginsToken")));
paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url);
hdCookies=new HashMap<>(response.getCookies());
Response token=this.hdGetToken(); //取消安全校验
String url = PROTOCOL + hdHost + hdLoginPath; hdCookies.remove("csrf_token");
Map<String,String> cookies=token.getCookies(); hdCookies.put("appId",appId);
Map<String, String> paras = new HashMap<>(); hdCookies.put("duibaAppId",appId);
paras.put("email", "wxs@duiba.com.cn"); hdCookiesSaasByApp.put(appId,hdCookies);
paras.put("password", SecurityUtils.getMD5("dbZcFiIc5yMHcee/o/PJEfyZjug="+from(token.asString()).getString("data.loginsToken")));
paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url);
Map<String,String> hdCookiesSaasByApp=new HashMap<>(response.getCookies());
//取消安全校验 i--;
hdCookiesSaasByApp.remove("csrf_token"); }
hdCookiesSaasByApp.put("appId",appId); return hdCookies;
return hdCookiesSaasByApp;
} }
//密码为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