|
|
@ -101,15 +101,17 @@ public class TokenFilter implements Filter {
|
|
|
|
filterChain.doFilter(request, response);
|
|
|
|
filterChain.doFilter(request, response);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取token
|
|
|
|
|
|
|
|
String token = request.getHeader("Authorization");
|
|
|
|
//针对大屏分享,优先处理
|
|
|
|
//针对大屏分享,优先处理
|
|
|
|
String shareToken = request.getHeader("Share-Token");
|
|
|
|
String shareToken = request.getHeader("Share-Token");
|
|
|
|
if (StringUtils.isNotBlank(shareToken)) {
|
|
|
|
if (StringUtils.isNotBlank(shareToken) && StringUtils.isBlank(token)) {
|
|
|
|
//两个接口需要处理
|
|
|
|
//需要处理
|
|
|
|
// /reportDashboard/getData
|
|
|
|
// /reportDashboard/getData
|
|
|
|
// /reportDashboard/{reportCode}
|
|
|
|
// /reportDashboard/{reportCode}
|
|
|
|
String reportCode = JwtUtil.getReportCode(shareToken);
|
|
|
|
// /reportExcel/preview
|
|
|
|
if (!uri.endsWith("/getData") && !uri.contains(reportCode)) {
|
|
|
|
List<String> reportCodeList = JwtUtil.getReportCodeList(shareToken);
|
|
|
|
|
|
|
|
if (!uri.endsWith("/reportDashboard/getData") && !uri.endsWith("/reportExcel/preview") && reportCodeList.stream().noneMatch(uri::contains)) {
|
|
|
|
ResponseBean responseBean = ResponseBean.builder().code("50014")
|
|
|
|
ResponseBean responseBean = ResponseBean.builder().code("50014")
|
|
|
|
.message("分享链接已过期").build();
|
|
|
|
.message("分享链接已过期").build();
|
|
|
|
response.getWriter().print(JSONObject.toJSONString(responseBean));
|
|
|
|
response.getWriter().print(JSONObject.toJSONString(responseBean));
|
|
|
@ -120,8 +122,7 @@ public class TokenFilter implements Filter {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取token
|
|
|
|
|
|
|
|
String token = request.getHeader("Authorization");
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
|
error(response);
|
|
|
|
error(response);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|