spring boot 前后端分离,跨域问题,后端进行处理
package com.kevin.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
- @Author: zhaoxiaogang
- @Date: 2018/11/26 20:54
*/
@Configuration
public class CorsConfigurer extends WebMvcConfigurerAdapter {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**");
}
}