Commit e80a6c6f authored by 黄奎's avatar 黄奎

跨域配置调整

parent c6c80f72
......@@ -43,41 +43,13 @@ namespace Edu.WebApi
options.JsonSerializerOptions.PropertyNamingPolicy = null;
});
services.AddSignalR();
List<string> corsArray = new List<string>()
List<string> corsArray = new List<string>();
string corsUrlStr = Common.Config.ReadConfigKey("corsUrl");
foreach (var item in corsUrlStr.Split(','))
{
"http://192.168.20.214:8400",
"http://localhost",
"http://localhost:8400",
"http://localhost:8081",
"http://localhost:8080",
"http://localhost:8181",
"http://localhost:8182",
"http://localhost:8082",
"http://127.0.0.1:50512",
"http://127.0.0.1:20224",
"http://127.0.0.1:28221",
"http://www.test.com:8080",
"http://www.test.com:8081",
"http://yx.oytour.com",
"http://mall.oytour.com",
"http://testmall.oytour.com",
"http://yx.oytour.com",
"http://edu.oytour.com",
"http://jiahe.oytour.com",
"http://jiahe.oytour.com",
"http://www.kookaku.com",
"http://www.kookaku.cn",
"http://kookaku.com",
"https://mallapi.oytour.com",
"https://mall.oytour.com",
"https://edu.kookaku.com",
"https://eduapi.oytour.com",
"http://eduapi.oytour.com",
"http://mobile.kookaku.com",
"http://m.kookaku.com",
"http://lm.oytour.com",
"http://192.168.10.9:8068",
};
corsArray.Add(item);
}
services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray())));
services.Configure<IISServerOptions>(options => options.AllowSynchronousIO = true);
......
......@@ -137,5 +137,6 @@
//判断学员约了比例
"ScrollAppointPercent": 0.01,
//排课显示的部门
"ShowDeptIds":"8,5"
"ShowDeptIds": "8,5",
"corsUrl": "http://192.168.20.214:8400,http://localhost,http://localhost:8400,http://localhost:8081,http://localhost:8080,http://localhost:8181,http://localhost:8182,http://localhost:8082,http://127.0.0.1:50512,http://127.0.0.1:20224,http://127.0.0.1:28221,http://www.test.com:8080,http://www.test.com:8081,http://yx.oytour.com,http://mall.oytour.com,http://testmall.oytour.com,http://yx.oytour.com,http://edu.oytour.com,http://jiahe.oytour.com,http://jiahe.oytour.com,http://www.kookaku.com,http://www.kookaku.cn,http://kookaku.com,https://mallapi.oytour.com,https://mall.oytour.com,https://edu.kookaku.com,https://eduapi.oytour.com,http://eduapi.oytour.com,http://mobile.kookaku.com,http://m.kookaku.com,http://lm.oytour.com,http://192.168.10.9:8068"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment