ajax请求接口时出现跨域问题解决

报错:Access to XMLHttpRequest at 'http://localhost:10348/TestApi/_Test' from origin 'http://localhost:41324' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 

配置文件中加上下面的代码可解决跨域问题 

  
    
      
        
        
        
      
      

 

你可能感兴趣的:(项目资源)