| | |
| | | */ |
| | | @Configuration |
| | | public class AuthInterceptor implements HandlerInterceptor { |
| | | private SysService sysService; |
| | | private final SysService sysService; |
| | | |
| | | private static final Log log = LogFactory.getLog(AuthInterceptor.class); |
| | | |
| | |
| | | |
| | | String url = request.getRequestURI(); |
| | | for (String perm : list) { |
| | | if (url.startsWith(perm)) { |
| | | if (url.contains(perm)) { |
| | | return true; |
| | | } |
| | | } |
| | |
| | | private boolean checkWhiteList(String ip, HttpServletRequest request) { |
| | | List<String> whiteList = sysService.blacklistService.selectIpList(2); |
| | | if (whiteList == null || whiteList.isEmpty()) { |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | return whiteList.contains(ip); |