html2canvas 模糊 html2canvas常见踩坑问题
一、html2canvas图片留白图片留白的问题应该是页面有滚动条,所以导致截屏又留白,解决方式有两种:1. 将页面window.scrollTo(0,0)这样可以解决,但是有的时候滚动会让用
顺晟科技
2021-06-28 19:45:05
145
1.写个配置类CorsConfig (如果不行,可以不写此类,和springcloud的版本有关)
package net.youqu.micro.service.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
import org.springframework.web.util.pattern.PathPatternParser;
/**
public class CorsConfig {
public CorsWebFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.addAllowedMethod("*");
config.addAllowedOrigin("*");
config.addAllowedHeader("*");
UrlBasedCorsConfigurationSource source = www.sangpi.comnew UrlBasedCorsConfigurationSource(new PathPatternParser());
source.registerCorsConfiguration("/**", config);
return new CorsWebFilter(source);
}
}
配置 application.properties 方式spring.cloud.gateway.globalcors.corsConfigurations.[/*].allowedOrigins=
spring.cloud.gateway.globalcors.corsConfigurations.[/*].allowedHeaders=
spring.cloud.gateway.globalcors.corsConfigurations.[/*].allowedMethods=
spring.cloud.gateway.globalcors.corsConfigurations.[/**].allowCredentials=true
yaml 方式
spring:
cloud:
gateway:
globalcors:
corsConfigurations:
'[/**]':
allowCredentials: true
allowedHeaders: '*'
allowedMethods: '*'
allowedOrigins: '*'
27
2022-09
15
2022-09
13
2022-09
13
2022-09
30
2021-10
30
2021-10