Compare commits
4 Commits
0549a077b2
...
0345ab85ec
| Author | SHA1 | Date | |
|---|---|---|---|
| 0345ab85ec | |||
| 6f64c8be81 | |||
| 1ce9b023ab | |||
| a1aebd16de |
@@ -43,7 +43,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||||||
userConfig.setIsShare(true);
|
userConfig.setIsShare(true);
|
||||||
// config2.setTimeout(2000);
|
// config2.setTimeout(2000);
|
||||||
userConfig.setTokenStyle("simple-uuid");
|
userConfig.setTokenStyle("simple-uuid");
|
||||||
MyStpLogic.USER_LOGIC.setConfig(userConfig);
|
MyStpLogic.CLIENT_LOGIC.setConfig(userConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -62,15 +62,18 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||||||
// 重置根路径,防止satoken切割根路径导致匹配不到路径
|
// 重置根路径,防止satoken切割根路径导致匹配不到路径
|
||||||
ApplicationInfo.routePrefix = "";
|
ApplicationInfo.routePrefix = "";
|
||||||
|
|
||||||
SaRouter
|
SaRouter.match("/user/**").notMatch("/user/login", "/user/test", "/user/geo/**", "/user/home/**", "/user/home/**", "/user/dict/**", "/user/openId")
|
||||||
.match("/user/**")
|
.notMatch("/pay/**")
|
||||||
.notMatch("/user/login", "/user/geo/**", "/user/home/**", "/user/dict/**", "/user/openId")
|
.notMatch("/notify/**")
|
||||||
.check(r -> MyStpLogic.USER_LOGIC.checkLogin())
|
.check(r -> MyStpLogic.CLIENT_LOGIC.checkLogin())
|
||||||
.setHit(true)
|
.setHit(true)
|
||||||
// .match("/**")
|
// .match("/**")
|
||||||
|
.notMatch("/user/**")
|
||||||
|
.notMatch("/pay/**")
|
||||||
.notMatch("/notify/**")
|
.notMatch("/notify/**")
|
||||||
.notMatch("/admin/auth/**")
|
.notMatch("/admin/auth/**")
|
||||||
.notMatch("/admin/shopMsgPush/subscribe/**")
|
.notMatch("/admin/shopMsgPush/subscribe/**")
|
||||||
|
.notMatch("/admin/coupon/grant")
|
||||||
.check(r -> {
|
.check(r -> {
|
||||||
ServletRequestAttributes attributes =
|
ServletRequestAttributes attributes =
|
||||||
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import java.util.function.Consumer;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Getter
|
@Getter
|
||||||
public class MyStpLogic {
|
public class MyStpLogic {
|
||||||
public static final StpLogic USER_LOGIC = new StpLogic("user");
|
public static final StpLogic CLIENT_LOGIC = new StpLogic("client");
|
||||||
public static final StpLogic ADMIN_LOGIC = new StpLogic("admin");
|
public static final StpLogic ADMIN_LOGIC = new StpLogic("admin");
|
||||||
|
|
||||||
public Object isPC() {
|
public Object isPC() {
|
||||||
@@ -42,7 +42,7 @@ public class MyStpLogic {
|
|||||||
private StpLogic getLogic() {
|
private StpLogic getLogic() {
|
||||||
boolean hit = SaRouter.match("/user/**").isHit();
|
boolean hit = SaRouter.match("/user/**").isHit();
|
||||||
if (hit) {
|
if (hit) {
|
||||||
return USER_LOGIC;
|
return CLIENT_LOGIC;
|
||||||
}
|
}
|
||||||
return ADMIN_LOGIC;
|
return ADMIN_LOGIC;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user