the front and rear ends are separated, the front end uses vue, and the back end uses springboot project to start the port is inconsistent.
allows cross-domain configuration in the springboot project, but it does not work
@ Configuration
public class CorsConfig implements WebMvcConfigurer { configuration class of
springboot
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("*")
.maxAge(3600);
}
}
did you guys write something wrong