| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- package com.ydtech.components;
- import cn.dev33.satoken.interceptor.SaInterceptor;
- import cn.dev33.satoken.router.SaRouter;
- import cn.dev33.satoken.stp.StpUtil;
- import org.springframework.stereotype.Component;
- import java.util.ArrayList;
- import java.util.List;
- @Component
- public class TokenInterceptor {
- public static SaInterceptor tokenInterceptor() {
- List<String> notMatchList = new ArrayList<>();
- notMatchList.add("/favicon.ico");
- notMatchList.add("/api/demo/**"); // 演示接口
- notMatchList.add("/captcha.jpg**"); // 验证码
- notMatchList.add("/login");
- notMatchList.add("/getQrCode"); //获取登录二维码
- notMatchList.add("/scanQrCode"); //扫描登录二维码
- notMatchList.add("/getQrCodeStatus"); //获取登录二维码状态
- notMatchList.add("/wechat/login"); // 微信登陆
- notMatchList.add("/captchaById"); // 验证码通过ID
- notMatchList.add("/login2");//登录2 配合验证码ID的校验
- notMatchList.add("/aapLogin");//合伙人和机构负责人登录APP接口
- notMatchList.add("/loginAPPByPhone");//合伙人和机构负责人登录APP接口
- notMatchList.add("/sendMsg");
- notMatchList.add("/loginByPhone");
- // notMatchList.add("/esmUserInternalcheck/userRegist");
- notMatchList.add("/dict/**"); //字典
- notMatchList.add("/user/agentRegist"); //个代注册
- notMatchList.add("/user/findById"); //获取用户信息
- notMatchList.add("/template/**"); //系统模板
- // 文件访问路劲
- notMatchList.add("/upload/**");
- // app 最大版本查询
- notMatchList.add("/sysVersion/queryMaxNum");
- notMatchList.add("/sysVersion/findPage");
- //财务 - 对账 - 保司数据下载
- notMatchList.add("/api/inv/insExternalBills/export/**");
- //中煤
- notMatchList.add("/zm/Underwriting"); //自动核保回调
- notMatchList.add("/zm/ArtificialUnderwriting"); //人工核保回调
- notMatchList.add("/order/zhongMeiApi/underwritingCallback");
- notMatchList.add("/order/zhongMeiApi/auditCallback");
- //永安
- notMatchList.add("/order/yongAn/updatePolicy"); // 支付回调
- notMatchList.add("/order/yongAn/getMessage"); // 获取短信消息
- // swagger
- notMatchList.add("/doc.html");
- notMatchList.add("/webjars/**");
- notMatchList.add("/swagger-resources");
- notMatchList.add("/v2/**");
- // 支付二维码地址
- notMatchList.add("/order/qrCode/index**");
- notMatchList.add("/order/qrCode/error");
- notMatchList.add("/order/qrCode/getQrCode**");
- notMatchList.add("/order/qrCode/destructionQrCode**");
- // 数据大屏接口
- notMatchList.add("/screen/data/**");
- // 保险公司列表
- notMatchList.add("/esmInsCompany/gainTopList");
- // 渤海回调地址
- notMatchList.add("/order/boHaiApi/underwritingCallback");
- notMatchList.add("/order/boHaiApi/auditCallback");
- notMatchList.add("/order/boHaiApi/policyResultCallback");
- // 支付宝登录
- notMatchList.add("/alipay/login");
- //企业微信绑定
- notMatchList.add("/wxWork/verifyBind");
- notMatchList.add("/wxWork/bind");
- // 微信客服
- notMatchList.add("/wechat/customer/callback");
- // 平安相关屏蔽地址
- notMatchList.add("/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode");
- notMatchList.add("/sysUserAccount/queryCount");
- notMatchList.add("/order/pingAnApi/recoverApplyVerifyCode");
- notMatchList.add("/order/pingAnApi/payReturn");
- notMatchList.add("/sysSys/sysList");//登录2 去除验证
- notMatchList.add("/pcWebsocket/*");//pcwebsocket
- notMatchList.add("/websocket/*");//APPwebsocket
- notMatchList.add("/user/saveUserInfoByPartner");
- notMatchList.add("/user/saveTeamLeader");
- notMatchList.add("/user/updateUserInfo1/*");
- notMatchList.add("/user/**");
- notMatchList.add("/user/saveTeamLeader");
- notMatchList.add("/ins/taskImage/uploadFileByPartner");
- notMatchList.add("/APPPartner/loginWechat");
- notMatchList.add("/APPPartner/loginAlipay");
- /**
- * 天天企赋api接口回调
- */
- notMatchList.add("/ttqf/paymentNotice");
- notMatchList.add("/ttqf/userSign");
- notMatchList.add("/ttqf/aa/*");
- notMatchList.add("/ttqf/**");
- notMatchList.add("/push/**");
- return new SaInterceptor(handler -> {
- // 指定一条 match 规则
- SaRouter
- .match("/**") // 拦截的 path 列表,可以写多个 */
- .notMatch(notMatchList) // 排除掉的 path 列表,可以写多个
- .check(r -> StpUtil.checkLogin());
- });
- }
- }
|