TokenInterceptor.java 4.9 KB

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