ServiceConfiguration.java 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.java110.front.configuration;
  2. import com.java110.front.filter.JwtFilter;
  3. import org.springframework.boot.web.servlet.FilterRegistrationBean;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. /**
  7. * Created by wuxw on 2018/5/2.
  8. */
  9. @Configuration
  10. public class ServiceConfiguration {
  11. @Bean
  12. public FilterRegistrationBean jwtFilter() {
  13. StringBuffer exclusions = new StringBuffer();
  14. exclusions.append("/callComponent/login/*,");
  15. exclusions.append("/callComponent/register/*,");
  16. exclusions.append("/callComponent/validate-code/*,");
  17. exclusions.append("/callComponent/validate-tel/*,");
  18. exclusions.append("/flow/login,");
  19. exclusions.append("/flow/register,");
  20. exclusions.append("/flow/advertVedioFlow,");//放开 广告页面是不需要登录的
  21. exclusions.append("/callComponent/advertVedioView/*,");//放开 广告页面是不需要登录的
  22. exclusions.append("/callComponent/download/getFile/file,");//放开 下载图片也不需要登录
  23. exclusions.append("/callComponent/download/getFile/fileByObjId,");//放开 下载图片也不需要登录
  24. exclusions.append("/app/payment/notify,");//微信支付通知
  25. exclusions.append("/app/payment/rentingNotify,");//微信支付通知
  26. exclusions.append("/app/payment/oweFeeNotify,");//欠费微信支付通知
  27. exclusions.append("/goods/notify,");//商品购买通知
  28. exclusions.append("/app/loginWx,");// 登录跳过
  29. exclusions.append("/app/getWxPhoto,");// 登录跳过
  30. exclusions.append("/app/loginProperty,");// 物业APP登录跳过
  31. exclusions.append("/app/loginOwner,");// 业主APP登录跳过
  32. exclusions.append("/app/loginOwnerByKey,");// 根据key登录业主
  33. exclusions.append("/app/area.listAreas,");// 加载地区
  34. exclusions.append("/app/community.listCommunitys,");// 加载小区
  35. exclusions.append("/app/user.userSendSms,");// 发送短信验证码
  36. exclusions.append("/app/owner.ownerRegister,");// 业主注册
  37. exclusions.append("/app/owner.ownerRegisterWxPhoto,");// 业主注册
  38. exclusions.append("/app/activities.listActivitiess,");//小区广告
  39. exclusions.append("/app/advert.listAdvertPhoto,");//小区广告图片
  40. exclusions.append("/app/junkRequirement.listJunkRequirements,");//市场
  41. exclusions.append("/app/wechat/gateway,");//微信公众号对接接口
  42. exclusions.append("/app/loginOwnerWechatAuth,");//微信公众号对接接口
  43. exclusions.append("/app/refreshToken,");//微信公众号对接接口
  44. exclusions.append("/app/renting/queryRentingPool,");//微信公众号对接接口
  45. exclusions.append("/app/activitiesType/queryActivitiesType,");//查询大类
  46. exclusions.append("/app/product/queryProductLabel,");//查询大类
  47. exclusions.append("/app/loginStaffWechatAuth,");//查询大类
  48. exclusions.append("/app/staffAuth");//查询大类
  49. final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
  50. registrationBean.setFilter(new JwtFilter());
  51. registrationBean.addUrlPatterns("/");
  52. registrationBean.addUrlPatterns("/callComponent/*");
  53. registrationBean.addUrlPatterns("/flow/*");
  54. registrationBean.addUrlPatterns("/app/*");
  55. registrationBean.addInitParameter("excludedUri",exclusions.toString());
  56. return registrationBean;
  57. }
  58. }