|
|
@@ -126,7 +126,6 @@ public class LoginWebFiter implements WebFilter {
|
|
|
|
|
|
public Boolean getUser(String cookie) throws IOException {
|
|
|
if (Objects.isNull(cookie)) {
|
|
|
- log.error("111111111");
|
|
|
return false;
|
|
|
}
|
|
|
if(UserContext.cMap.containsKey(cookie)){
|
|
|
@@ -144,14 +143,10 @@ public class LoginWebFiter implements WebFilter {
|
|
|
HttpEntity entity = response.getEntity();
|
|
|
String result = EntityUtils.toString(entity);
|
|
|
EntityUtils.consume(entity);
|
|
|
- log.error("3");
|
|
|
if (Objects.nonNull(result)) {
|
|
|
- log.error("4");
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(result);
|
|
|
if (jsonObject.containsKey("code") && jsonObject.get("code", Integer.class) == 200) {
|
|
|
- log.error("5");
|
|
|
if(jsonObject.containsKey("data")){
|
|
|
- log.error("7");
|
|
|
XxlSsoUser data = jsonObject.get("data", XxlSsoUser.class);
|
|
|
BaseContextHandler.setUserId(data.getUserid());
|
|
|
BaseContextHandler.setUserName(data.getUsername());
|
|
|
@@ -160,19 +155,16 @@ public class LoginWebFiter implements WebFilter {
|
|
|
return true;
|
|
|
}
|
|
|
}else if(jsonObject.containsKey("code") && jsonObject.get("code", Integer.class) == 501){
|
|
|
- log.error("7.1");
|
|
|
return false;
|
|
|
}else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
- log.error("8");
|
|
|
} catch (Exception e) {
|
|
|
return true;
|
|
|
} finally {
|
|
|
response.close();
|
|
|
}
|
|
|
- log.error("2222222222222");
|
|
|
return true;
|
|
|
|
|
|
}
|