|
@@ -29,8 +29,8 @@ public class RequestFilter implements Filter {
|
|
|
Cookie[] cookies = httpRequest.getCookies();
|
|
Cookie[] cookies = httpRequest.getCookies();
|
|
|
String userId = httpRequest.getHeader("userid");
|
|
String userId = httpRequest.getHeader("userid");
|
|
|
String userName = httpRequest.getHeader("username");
|
|
String userName = httpRequest.getHeader("username");
|
|
|
- String orgCode = httpRequest.getHeader("orgCode");
|
|
|
|
|
- String roleCodes = httpRequest.getHeader("roleCodes");
|
|
|
|
|
|
|
+ String orgCode = httpRequest.getHeader("orgcode");
|
|
|
|
|
+ String roleCodes = httpRequest.getHeader("rolecodes");
|
|
|
//获取cookie用户数据
|
|
//获取cookie用户数据
|
|
|
if (cookies != null && cookies.length > 0) {
|
|
if (cookies != null && cookies.length > 0) {
|
|
|
for (Cookie cookie : cookies) {
|
|
for (Cookie cookie : cookies) {
|
|
@@ -48,9 +48,11 @@ public class RequestFilter implements Filter {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- userName = URLDecoder.decode(userName, "utf-8");
|
|
|
|
|
- orgCode = URLDecoder.decode(orgCode, "utf-8");
|
|
|
|
|
- roleCodes = URLDecoder.decode(roleCodes, "utf-8");
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ userName = URLDecoder.decode(userName, "utf-8");
|
|
|
|
|
+ orgCode = URLDecoder.decode(orgCode, "utf-8");
|
|
|
|
|
+ roleCodes = URLDecoder.decode(roleCodes, "utf-8");
|
|
|
|
|
+ }catch (Exception e){}
|
|
|
httpRequest.setAttribute("userId", userId);
|
|
httpRequest.setAttribute("userId", userId);
|
|
|
httpRequest.setAttribute("userName", userName);
|
|
httpRequest.setAttribute("userName", userName);
|
|
|
httpRequest.setAttribute("orgCode", orgCode);
|
|
httpRequest.setAttribute("orgCode", orgCode);
|
|
@@ -76,6 +78,7 @@ public class RequestFilter implements Filter {
|
|
|
chain.doFilter(request, response);
|
|
chain.doFilter(request, response);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
chain.doFilter(request, response);
|
|
chain.doFilter(request, response);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|