一、该问题的重现步骤是什么?
spring-boot版本怎么才能允许访问static下的html?
一直提示签名认证失败
yml里已经设置了:
: : : always : : : /static/** : : classpath:/static/
都不生效
2.
3.
二、你期待的结果是什么?实际看到的又是什么?
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
四、请提供详细的错误堆栈信息,这很重要。
五、若有更多详细信息,请在下面提供。
@Configuration
public class BladeConfiguration implements WebMvcConfigurer {
@Bean
public SecureRegistry secureRegistry() {
SecureRegistry secureRegistry = new SecureRegistry();
secureRegistry.setEnabled(true);
secureRegistry.excludePathPatterns("/blade-auth/**");
secureRegistry.excludePathPatterns("/blade-log/**");
secureRegistry.excludePathPatterns("/blade-system/menu/routes");
secureRegistry.excludePathPatterns("/blade-system/menu/auth-routes");
secureRegistry.excludePathPatterns("/blade-system/menu/top-menu");
secureRegistry.excludePathPatterns("/blade-system/tenant/info");
secureRegistry.excludePathPatterns("/blade-flow/process/resource-view");
secureRegistry.excludePathPatterns("/blade-flow/process/diagram-view");
secureRegistry.excludePathPatterns("/blade-flow/manager/check-upload");
secureRegistry.excludePathPatterns("/doc.html");
secureRegistry.excludePathPatterns("/js/**");
secureRegistry.excludePathPatterns("/webjars/**");
secureRegistry.excludePathPatterns("/swagger-resources/**");
secureRegistry.excludePathPatterns("/druid/**");
secureRegistry.excludePathPatterns("/agilebpm-ui/**");
return secureRegistry;
}
@Bean
@ConditionalOnProperty(value = "blade.preview.enabled", havingValue = "true")
public PreviewFilter previewFilter() {
return new PreviewFilter();
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedHeaders("*")
.allowedMethods("*")
.maxAge(3600)
.allowCredentials(true);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/agilebpm-ui/**").addResourceLocations("classpath:/static/agilebpm-ui/");
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setSerializerFeatures(SerializerFeature.WriteDateUseDateFormat);
fastJsonConfig.setSerializeFilters(new AbValueFilter());
FastJsonHttpMessageConverter fastJsonHttpMessageConverter = new FastJsonHttpMessageConverter();
fastJsonHttpMessageConverter.setDefaultCharset(StandardCharsets.UTF_8);
fastJsonHttpMessageConverter.setSupportedMediaTypes(Arrays.asList(MediaType.TEXT_HTML, MediaType.APPLICATION_JSON_UTF8));
fastJsonHttpMessageConverter.setFastJsonConfig(fastJsonConfig);
converters.add(0, fastJsonHttpMessageConverter);
}
}
参考这个配置
扫一扫访问 Blade技术社区 移动端