派生自 projectDept/qhighschool

yn147
2023-05-10 96286178ee1c257c130cb2ad964a781f36c4eee5
src/main/java/com/qxueyou/scc/web/AuthorizeFilter.java
@@ -48,7 +48,7 @@
   private String[] excludeUrls;
   
   /**
    * 非法请求返回结果
    * 非法请求返回结果
    */
   private String forbidden = JSONObject.toJSONString(new Result(false,Result.CODE_FORBIDDEN));
   
@@ -56,7 +56,7 @@
   @Override
   public void init(FilterConfig filterConfig) throws ServletException {
      // 从配置文件中获取excludeUrls
      // 从配置文件中获取excludeUrls
      String excludeUrl = sccConfig.getExcludeUrl();
      if (!StringUtils.isEmpty(excludeUrl)) {
@@ -86,21 +86,21 @@
      String url = httpRequest.getRequestURI();
      log.debug("request URI:" + url);
      
      // 是否略过
      // 是否略过
      if (ArrayUtils.isEmpty(excludeUrls) || isExclude(httpRequest)) {
         filterChain.doFilter(httpRequest, httpResponse);
         return;
      }
      
      //是否合法
      //是否合法
//      if(!licenseService.isValid()) {
//         log.debug("license invalid");
//         forbiddenAsLicense(httpResponse);
//         return;
//      }
////         forbiddenAsLicense(httpResponse);
////         return;
////      }
      if (!addClientInfo(httpRequest)) {
         log.debug("非法请求:" + httpRequest.getRequestURI());
         log.debug("非法请求:" + httpRequest.getRequestURI());
         forbidden(httpResponse);
         return;
      }
@@ -128,7 +128,7 @@
   
   /**
    * 绑定客户端信息
    * 绑定客户端信息
    * 
    * @param httpRequest
    * @param cookieKey
@@ -142,10 +142,10 @@
         return false;
      }
      
      //获取用户对应的sessionId是否与保存在redis中的一致,如果不一致,如果不一致则跳转到登录页面
      //获取用户对应的sessionId是否与保存在redis中的一致,如果不一致,如果不一致则跳转到登录页面
      //String currOnlineSessinId = (String) stringRedisTemplate.opsForHash().get(UserInfoWrapper.REDIS_USER_ONLINE_MAP_KEY, wrapper.getInfo(UserInfoWrapper.INF_USER_ID));
      //如果不存在,则返回
      //如果不存在,则返回
//      if(!session.getId().equalsIgnoreCase(currOnlineSessinId)){
//         session.invalidate();
//         return false;
@@ -156,7 +156,7 @@
   }
   /**
    * 是否过滤掉
    * 是否过滤掉
    * 
    * @param httpRequest
    * @return