solon 升为 3.0.1

This commit is contained in:
noear 2024-10-07 20:23:55 +08:00
parent a4b63f5875
commit d3d11ce2b9

View File

@ -40,13 +40,15 @@ public class Config {
@Bean
public void saTokenPathInterceptor2() {
Solon.app().before((ctx) -> {
Solon.app().routerInterceptor((ctx, mainHandler, chain) -> {
SaRouter.match("/**", StpUtil::checkLogin);
// 根据路由划分模块不同模块不同鉴权
SaRouter.match("/user/**", r -> StpUtil.checkPermission("user"));
SaRouter.match("/admin/**", r -> StpUtil.checkPermission("admin"));
SaRouter.match("/goods/**", r -> StpUtil.checkPermission("goods"));
SaRouter.match("/orders/**", r -> StpUtil.checkPermission("orders"));
chain.doIntercept(ctx, mainHandler);
});
}
}