解决办法
@SpringBootApplication
@MapperScan("com.humorchen.pastry_examination.mapper")
public class PastryExaminationApplication implements WebMvcConfigurer {
public static void main(String[] args) {
SpringApplication.run(PastryExaminationApplication.class, args);
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowCredentials(true)
.allowedHeaders("*")
.allowedOriginPatterns("*")
.allowedMethods("*");
}
}