解决方法:在StartUp.cs文件中Configure(IApplicationBuilder app, IHostingEnvironment env)方法中添加如下代码://跨域 app.UseHttpsRedirection().UseCors(builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());