| | |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.framework.interceptor.MiddlePlatformReadonlyInterceptor; |
| | | import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; |
| | | |
| | | /** |
| | |
| | | { |
| | | @Autowired |
| | | private RepeatSubmitInterceptor repeatSubmitInterceptor; |
| | | |
| | | @Autowired |
| | | private MiddlePlatformReadonlyInterceptor middlePlatformReadonlyInterceptor; |
| | | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) |
| | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) |
| | | { |
| | | // 中台模式只读拦截必须覆盖原生部门接口,部门页面使用 /system/dept 而不是访客自定义前缀。 |
| | | registry.addInterceptor(middlePlatformReadonlyInterceptor).addPathPatterns( |
| | | "/system/visit/area/**", |
| | | "/system/dept", |
| | | "/system/dept/**", |
| | | "/system/employee/**", |
| | | "/system/visitor/record/**", |
| | | "/system/visitor/machine/**", |
| | | "/system/door/device/**", |
| | | "/system/version/update/**", |
| | | "/system/protocol/config/**", |
| | | "/system/platform/admin/**", |
| | | "/system/role/manage/**" |
| | | ); |
| | | registry.addInterceptor(repeatSubmitInterceptor).addPathPatterns("/**"); |
| | | } |
| | | |
| | |
| | | // 返回新的CorsFilter |
| | | return new CorsFilter(source); |
| | | } |
| | | } |
| | | } |