跨域

方案1:通过代码指定

apiObj.InterfaceOptions.CorsOptions = new ReZeroCors()
{ 
    Enable=true,//true才启用
    Headers=new string[] { "*"},
    Methods = new string[] { "*" },
    Origins= new string[] { "*" },
    PolicyName= "cors",
    AllowCredentials=false//AllowCredentials为ture得时候,origins得配置具体值,不能是通配符*
};

方案2:通过配置json

1.6.13 版本支持了:AllowCredentials 

AllowCredentials为ture得时候,origins得配置具体值,不能是通配符*

image.png

完整json文件用法

https://www.donet5.com/Doc/32/2585




果糖网