|
@@ -2,7 +2,6 @@ package com.project.zcustom.config;
|
|
|
|
|
|
import cn.dev33.satoken.interceptor.SaInterceptor;
|
|
import cn.dev33.satoken.interceptor.SaInterceptor;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
@@ -12,11 +11,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
* @Date 2025/2/25 18:20
|
|
* @Date 2025/2/25 18:20
|
|
* @Version 1.0
|
|
* @Version 1.0
|
|
*/
|
|
*/
|
|
-@Configuration
|
|
|
|
|
|
+//@Configuration
|
|
public class SaTokenConfigure implements WebMvcConfigurer {
|
|
public class SaTokenConfigure implements WebMvcConfigurer {
|
|
|
|
|
|
// 注册拦截器
|
|
// 注册拦截器
|
|
- @Override
|
|
|
|
|
|
+ //@Override
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。
|
|
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。
|
|
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
|
|
registry.addInterceptor(new SaInterceptor(handle -> StpUtil.checkLogin()))
|