| | |
| | | // boolean detailworkguide = !requestURI.contains("workguide/detailworkguide"); |
| | | // boolean pagedynamic = !requestURI.contains("partybuilding/pagedynamic"); |
| | | // boolean infodynamic = !requestURI.contains("partybuilding/infodynamic"); |
| | | |
| | | SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request); |
| | | if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement||wxPay |
| | | ||wxCgi||isShop||listadvertisement||noToken||bigscreen) { |
| | |
| | | safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_USERINFO,hexStr ); |
| | | } |
| | | } else { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败")); |
| | | return; |
| | | //小程序无需登录也可访问地址列表 |
| | | List<String> noLoginUrl = new ArrayList<>(); |
| | | noLoginUrl.add("/api/applets/community/detaildynamic"); |
| | | noLoginUrl.add("/api/applets/community/detailactivity"); |
| | | if(noLoginUrl.contains(requestURI)){ |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |
| | | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null, authorities); |
| | | SecurityContextHolder.getContext().setAuthentication(authentication); |
| | | }else { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败")); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | filterChain.doFilter(safeboxRequestWrapper,response); |