Springboot configuration cross-domain does not work

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

Apr.13,2022

add @ CrossOrigin annotation to the controller layer


is the session missing? the cross-domain problem needs to cooperate with the front end, and the front paragraph has to be dealt with

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ac06-2c248.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ac06-2c248.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?