from origin 'http://localhost:8080' has been blocked by CORS policy

`package com.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**

  • Author:js
  • Date:2019/

*/
@Configuration
@EnableWebMvc
public class CorsConfig extends WebMvcConfigurerAdapter {

@Override
public void addCorsMappings(CorsRegistry registry) {
    registry.addMapping("/**");
}

}`


小白
10 声望1 粉丝

gambler


« 上一篇
9-3
下一篇 »
并发 jvm