Commit baf6eec8 authored by 黄奎's avatar 黄奎

页面修改

parent dc99c7bd
......@@ -109,6 +109,28 @@ namespace Mall.Common
return valueStr;
}
/// <summary>
/// redis服务器
/// </summary>
public static string RedisServer
{
get
{
return ReadConfigKey("RedisSetting", "RedisServer");
}
}
/// <summary>
/// redis密码
/// </summary>
public static string RedisPwd
{
get
{
return ReadConfigKey("RedisSetting", "RedisPwd");
}
}
/// <summary>
/// 超级管理员id
/// </summary>
......
......@@ -77,22 +77,27 @@ namespace Mall.WebApi
"https://mallapi.oytour.com",
"http://edu.oytour.com",
"http://jvs.oytour.com",
"http://pic.oytour.com"
"http://pic.oytour.com",
"http://admin.jjsw.vip",
"http://mallweb.jjsw.vip",
};
services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray())));
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor
| Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto;
options.KnownProxies.Add(IPAddress.Parse("47.96.12.235"));
});
//services.Configure<ForwardedHeadersOptions>(options =>
//{
// options.ForwardedHeaders = Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor
// | Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto;
// options.KnownProxies.Add(IPAddress.Parse("47.96.12.235"));
//});
string redisConnStr = $"{Common.Config.RedisServer},password={Common.Config.RedisPwd},connectTimeout=5000,allowAdmin=false,defaultDatabase=0";
//Api限流
services.AddApiThrottle(options => {
services.AddApiThrottle(options =>
{
//配置redis
options.UseRedisCacheAndStorage(opts => {
opts.ConnectionString = "47.96.23.199,password=Viitto2018,connectTimeout=5000,allowAdmin=false,defaultDatabase=0";
options.UseRedisCacheAndStorage(opts =>
{
opts.ConnectionString = redisConnStr;
opts.KeyPrefix = "apithrottle"; //指定给所有key加上前缀,默认为apithrottle
});
});
......
......@@ -79,7 +79,7 @@
"Password": "viitto2019"
},
"RedisSetting": {
"RedisServer": "47.96.23.199",
"RedisServer": "192.168.10.214",
"RedisPort": "6379",
"RedisPwd": "Viitto2018"
},
......
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