如果是自定义的header名称,须要在跨域中设置:.WithExposedHeaders(“X-Total-Count”)
services.AddCors(options =>
{
options.AddPolicy("AllowAllOrigin", builder =>
{
builder
.AllowAnyOrigin()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials()
.WithExposedHeaders("X-Total-Count")
.WithExposedHeaders("X-Pagination");
});
});