TokenInterceptor.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package com.ydtech.components;
  2. import cn.dev33.satoken.interceptor.SaInterceptor;
  3. import cn.dev33.satoken.router.SaRouter;
  4. import cn.dev33.satoken.stp.StpUtil;
  5. import org.springframework.stereotype.Component;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. @Component
  9. public class TokenInterceptor {
  10. public static SaInterceptor tokenInterceptor() {
  11. List<String> notMatchList = new ArrayList<>();
  12. notMatchList.add("/favicon.ico");
  13. notMatchList.add("/api/demo/**"); // 演示接口
  14. notMatchList.add("/captcha.jpg**"); // 验证码
  15. notMatchList.add("/login");
  16. notMatchList.add("/getQrCode"); //获取登录二维码
  17. notMatchList.add("/scanQrCode"); //扫描登录二维码
  18. notMatchList.add("/getQrCodeStatus"); //获取登录二维码状态
  19. notMatchList.add("/getToken"); //获取token
  20. notMatchList.add("/wechat/login"); // 微信登陆
  21. notMatchList.add("/captchaById"); // 验证码通过ID
  22. notMatchList.add("/login2");//登录2 配合验证码ID的校验
  23. notMatchList.add("/system/login");//登录PC
  24. notMatchList.add("/aapLogin");//合伙人和机构负责人登录APP接口
  25. notMatchList.add("/loginAPPByPhone");//合伙人和机构负责人登录APP接口
  26. notMatchList.add("/sendMsg");
  27. notMatchList.add("/loginByPhone");
  28. // notMatchList.add("/esmUserInternalcheck/userRegist");
  29. notMatchList.add("/dict/**"); //字典
  30. notMatchList.add("/user/agentRegist"); //个代注册
  31. notMatchList.add("/user/findById"); //获取用户信息
  32. notMatchList.add("/template/**"); //系统模板
  33. // 文件访问路劲
  34. notMatchList.add("/upload/**");
  35. // app 最大版本查询
  36. notMatchList.add("/sysVersion/queryMaxNum");
  37. notMatchList.add("/sysVersion/findPage");
  38. //财务 - 对账 - 保司数据下载
  39. notMatchList.add("/api/inv/insExternalBills/export/**");
  40. //中煤
  41. notMatchList.add("/zm/Underwriting"); //自动核保回调
  42. notMatchList.add("/zm/ArtificialUnderwriting"); //人工核保回调
  43. notMatchList.add("/order/zhongMeiApi/underwritingCallback");
  44. notMatchList.add("/order/zhongMeiApi/auditCallback");
  45. //永安
  46. notMatchList.add("/order/yongAn/updatePolicy"); // 支付回调
  47. notMatchList.add("/order/yongAn/getMessage"); // 获取短信消息
  48. // swagger
  49. notMatchList.add("/doc.html");
  50. notMatchList.add("/webjars/**");
  51. notMatchList.add("/swagger-resources");
  52. notMatchList.add("/v2/**");
  53. // 支付二维码地址
  54. notMatchList.add("/order/qrCode/index**");
  55. notMatchList.add("/order/qrCode/error");
  56. notMatchList.add("/order/qrCode/getQrCode**");
  57. notMatchList.add("/order/qrCode/destructionQrCode**");
  58. // 数据大屏接口
  59. notMatchList.add("/screen/data/**");
  60. // 保险公司列表
  61. notMatchList.add("/esmInsCompany/gainTopList");
  62. // 渤海回调地址
  63. notMatchList.add("/order/boHaiApi/underwritingCallback");
  64. notMatchList.add("/order/boHaiApi/auditCallback");
  65. notMatchList.add("/order/boHaiApi/policyResultCallback");
  66. // 支付宝登录
  67. notMatchList.add("/alipay/login");
  68. //企业微信绑定
  69. notMatchList.add("/wxWork/verifyBind");
  70. notMatchList.add("/wxWork/bind");
  71. // 微信客服
  72. notMatchList.add("/wechat/customer/callback");
  73. // 平安相关屏蔽地址
  74. notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
  75. notMatchList.add("/sysUserAccount/queryCount");
  76. notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
  77. notMatchList.add("/order/pingAnApi/payReturn");
  78. notMatchList.add("/upload/bigOrderCountUpload");
  79. notMatchList.add("/sysSys/sysList");//登录2 去除验证
  80. notMatchList.add("/pcWebsocket/*");//pcwebsocket
  81. notMatchList.add("/websocket/*");//APPwebsocket
  82. notMatchList.add("/user/saveUserInfoByPartner");
  83. notMatchList.add("/user/saveTeamLeader");
  84. notMatchList.add("/user/updateUserInfo1/*");
  85. notMatchList.add("/user/**");
  86. notMatchList.add("/user/saveTeamLeader");
  87. notMatchList.add("/ins/taskImage/uploadFileByPartner");
  88. notMatchList.add("/APPPartner/loginWechat");
  89. notMatchList.add("/APPPartner/loginAlipay");
  90. /**
  91. * 天天企赋api接口回调
  92. */
  93. notMatchList.add("/ttqf/paymentNotice");
  94. notMatchList.add("/ttqf/userSign");
  95. notMatchList.add("/ttqf/aa/*");
  96. notMatchList.add("/ttqf/**");
  97. notMatchList.add("/push/**");
  98. return new SaInterceptor(handler -> {
  99. // 指定一条 match 规则
  100. SaRouter
  101. .match("/**") // 拦截的 path 列表,可以写多个 */
  102. .notMatch(notMatchList) // 排除掉的 path 列表,可以写多个
  103. .check(r -> StpUtil.checkLogin());
  104. });
  105. }
  106. }