会员充值/霸王餐支付 关联id问题
统一异常拦截 rootCause 值 CLIENT_LOGIC 与 USER_LOGIC 问题
This commit is contained in:
@@ -43,7 +43,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
userConfig.setIsShare(true);
|
||||
// config2.setTimeout(2000);
|
||||
userConfig.setTokenStyle("simple-uuid");
|
||||
MyStpLogic.CLIENT_LOGIC.setConfig(userConfig);
|
||||
MyStpLogic.USER_LOGIC.setConfig(userConfig);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@@ -62,18 +62,15 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
// 重置根路径,防止satoken切割根路径导致匹配不到路径
|
||||
ApplicationInfo.routePrefix = "";
|
||||
|
||||
SaRouter.match("/user/**").notMatch("/user/login", "/user/test", "/user/geo/**", "/user/home/**", "/user/home/**", "/user/dict/**", "/user/openId")
|
||||
.notMatch("/pay/**")
|
||||
.notMatch("/notify/**")
|
||||
.check(r -> MyStpLogic.CLIENT_LOGIC.checkLogin())
|
||||
SaRouter
|
||||
.match("/user/**")
|
||||
.notMatch("/user/login", "/user/geo/**", "/user/home/**", "/user/dict/**", "/user/openId")
|
||||
.check(r -> MyStpLogic.USER_LOGIC.checkLogin())
|
||||
.setHit(true)
|
||||
// .match("/**")
|
||||
.notMatch("/user/**")
|
||||
.notMatch("/pay/**")
|
||||
.notMatch("/notify/**")
|
||||
.notMatch("/admin/auth/**")
|
||||
.notMatch("/admin/shopMsgPush/subscribe/**")
|
||||
.notMatch("/admin/coupon/grant")
|
||||
.check(r -> {
|
||||
ServletRequestAttributes attributes =
|
||||
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.function.Consumer;
|
||||
@Slf4j
|
||||
@Getter
|
||||
public class MyStpLogic {
|
||||
public static final StpLogic CLIENT_LOGIC = new StpLogic("client");
|
||||
public static final StpLogic USER_LOGIC = new StpLogic("user");
|
||||
public static final StpLogic ADMIN_LOGIC = new StpLogic("admin");
|
||||
|
||||
public Object isPC() {
|
||||
@@ -42,7 +42,7 @@ public class MyStpLogic {
|
||||
private StpLogic getLogic() {
|
||||
boolean hit = SaRouter.match("/user/**").isHit();
|
||||
if (hit) {
|
||||
return CLIENT_LOGIC;
|
||||
return USER_LOGIC;
|
||||
}
|
||||
return ADMIN_LOGIC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user