21 changed files with 207 additions and 71 deletions
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.yyth.config; |
||||
|
|
||||
|
import cn.dev33.satoken.interceptor.SaInterceptor; |
||||
|
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.WebMvcConfigurer; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/5/16 14:43 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
public class SaTokenConfigure implements WebMvcConfigurer { |
||||
|
|
||||
|
// 注册 Sa-Token 拦截器
|
||||
|
@Override |
||||
|
public void addInterceptors(InterceptorRegistry registry) { |
||||
|
// 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。
|
||||
|
registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin())) |
||||
|
.addPathPatterns("/**") |
||||
|
.excludePathPatterns("/sysuser/doLogin") |
||||
|
.excludePathPatterns("/lpkgiftcard/gifCardByCustomerSid") |
||||
|
.excludePathPatterns("/empcardgift/gifCardByCustomerSid") |
||||
|
.excludePathPatterns("/empcard/getEmpCardByCustomerSid") |
||||
|
.excludePathPatterns("/lpkgiftcard/getGifCardBySid/**") |
||||
|
.excludePathPatterns("/empcardgift/getGifCardBySid/**") |
||||
|
.excludePathPatterns("/empcard/getEmpCardBySid/**") |
||||
|
.excludePathPatterns("/lpkgiftcard/isSaturAndSun/**") |
||||
|
.excludePathPatterns("/empcardgift/isSaturAndSun/**") |
||||
|
.excludePathPatterns("/lpkgiftcard/getReservationBySid/**") |
||||
|
.excludePathPatterns("/lpksreservoorder/submission") |
||||
|
.excludePathPatterns("/empsreservoorder/submission") |
||||
|
.excludePathPatterns("/empcardgift/generateCard") |
||||
|
.excludePathPatterns("/lpkgiftcard/bindCard") |
||||
|
.excludePathPatterns("/empcard/bindCard") |
||||
|
.excludePathPatterns("/lpksreservoorder/orderByCardSid/**") |
||||
|
.excludePathPatterns("/lpksreservoorder/orderListByUserSid/**") |
||||
|
.excludePathPatterns("/lpksreservoorder/orderDetails/**") |
||||
|
.excludePathPatterns("/lpkgoods/goodsDetails/**") |
||||
|
.excludePathPatterns("/lpkstore/getAllStoreByQuery") |
||||
|
.excludePathPatterns("/lpkcustomer/wxSilentLogin"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue