Closed zjc-china closed 3 years ago
app.UseRouting(); app.UseAuthorization(); app.UseCors("AllowSameDomain"); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); 如上,应该放在 app.UseRouting(); 和 UseEndpoints 之间
收到
app.UseCors("AllowSameDomain"); 应该在 app.UseAuthorization(); 之前
(CORS) 启用跨域请求 ASP.NET Core
收到,已修改。
app.UseRouting(); app.UseAuthorization(); app.UseCors("AllowSameDomain"); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); 如上,应该放在 app.UseRouting(); 和 UseEndpoints 之间