1.安裝Microsoft.AspNetCore.Mvc.Cors;
2.在startup.cs中配置

3.然後localhost:3002就可以跨域請求了。如果想所有的網站都可以請求,把allowanyoriginas替換withorigins
1.安裝Microsoft.AspNetCore.Mvc.Cors;
2.在startup.cs中配置
3.然後localhost:3002就可以跨域請求了。如果想所有的網站都可以請求,把allowanyoriginas替換withorigins