126 lines
4.1 KiB
JSON
126 lines
4.1 KiB
JSON
{
|
||
"Logging": {
|
||
"LogLevel": {
|
||
"Default": "Information",
|
||
"Microsoft": "Warning",
|
||
"Microsoft.Hosting.Lifetime": "Information"
|
||
}
|
||
},
|
||
"ConnectionStrings": {
|
||
"conn_db": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;uid=sa;pwd=zradmin123;database=ZrAdmin;Trusted_Connection=SSPI"
|
||
},
|
||
"conn_db_dbtype": 1, //数据库类型 MySql = 0, SqlServer = 1
|
||
"urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||
"corsUrls": "http://localhost:8887", //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||
"JwtSettings": {
|
||
"Issuer": "ZRAdmin.NET",
|
||
"Audience": "ZRAdmin.NET",
|
||
"SecretKey": "SecretKey-ZRADMIN.NET-20210101",
|
||
"Expire": 1440 //jwt登录过期时间(分)
|
||
},
|
||
"DemoMode": false, //是否演示模式
|
||
"Upload": {
|
||
"UploadUrl": "http://localhost:8888"
|
||
},
|
||
//阿里云存储配置
|
||
"ALIYUN_OSS": {
|
||
"REGIONID": "cn-hangzhou",
|
||
"KEY": "XX",
|
||
"SECRET": "XX",
|
||
"bucketName": "bucketName",
|
||
"domainUrl": "http://xxx.xxx.com" //访问资源域名
|
||
},
|
||
"gen": {
|
||
"conn": "server=LAPTOP-STKF2M8H\\SQLEXPRESS;user=zr;pwd=abc;database=ZrAdmin;Trusted_Connection=SSPI",
|
||
"dbType": 1, //MySql = 0, SqlServer = 1
|
||
"autoPre": true, //自动去除表前缀
|
||
"author": "admin",
|
||
"tablePrefix": "sys_", //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",
|
||
"vuePath": "" //前端代码存储路径eg:D:\Work\ZRAdmin-Vue3
|
||
},
|
||
//邮箱配置信息
|
||
"MailOptions": {
|
||
//发送人邮箱
|
||
"From": "", //eg:xxxx@qq.com
|
||
//发送人邮箱密码
|
||
"Password": "123456",
|
||
//协议
|
||
"Smtp": "smtp.qq.com",
|
||
"Port": 587
|
||
},
|
||
//redis服务配置
|
||
"RedisServer": {
|
||
"Cache": "127.0.0.1:6379,defaultDatabase=0,poolsize=50,ssl=false,writeBuffer=10240,prefix=cache:",
|
||
"Session": "127.0.0.1:6379,defaultDatabase=0,poolsize=50,ssl=false,writeBuffer=10240,prefix=session:"
|
||
},
|
||
//接口请求限制
|
||
"IpRateLimiting": {
|
||
//例如设置了5次每分钟访问限流。当False时:项目中每个接口都加入计数,不管你访问哪个接口,只要在一分钟内累计够5次,将禁止访问。
|
||
//True:当一分钟请求了5次GetData接口,则该接口将在时间段内禁止访问,但是还可以访问PostData()5次,总得来说是每个接口都有5次在这一分钟,互不干扰。
|
||
"EnableEndpointRateLimiting": true,
|
||
//false,拒绝的API调用不会添加到调用次数计数器上;如 客户端每秒发出3个请求并且您设置了每秒一个调用的限制,则每分钟或每天计数器等其他限制将仅记录第一个调用,即成功的API调用。如果您希望被拒绝的API调用计入其他时间的显示(分钟,小时等)
|
||
//,则必须设置StackBlockedRequests为true。
|
||
"StackBlockedRequests": false,
|
||
"RealIpHeader": "X-Real-IP",
|
||
//取白名单的客户端ID。如果此标头中存在客户端ID并且与ClientWhitelist中指定的值匹配,则不应用速率限制。
|
||
"ClientIdHeader": "X-ClientId",
|
||
"HttpStatusCode": 429,
|
||
//端点白名单
|
||
"EndpointWhitelist": [ "post:/system/dict/data/types", "*:/msghub/negotiate", "*:/LogOut" ],
|
||
//客户端白名单
|
||
//"ClientWhitelist": [ "dev-id-1", "dev-id-2" ],
|
||
"QuotaExceededResponse": {
|
||
"Content": "{{\"code\":429,\"msg\":\"访问过于频繁,请稍后重试\"}}",
|
||
"ContentType": "application/json",
|
||
"StatusCode": 429
|
||
},
|
||
//通用规则,api规则,结尾一定要带*
|
||
"GeneralRules": [
|
||
{
|
||
"Endpoint": "*:/captchaImage",
|
||
//时间段,格式:{数字}{单位};可使用单位:s, m, h, d
|
||
"Period": "3s",
|
||
"Limit": 5
|
||
},
|
||
{
|
||
"Endpoint": "post:*",
|
||
//时间段,格式:{数字}{单位};可使用单位:s, m, h, d
|
||
"Period": "3s",
|
||
"Limit": 1
|
||
},
|
||
{
|
||
"Endpoint": "put:*",
|
||
//时间段,格式:{数字}{单位};可使用单位:s, m, h, d
|
||
"Period": "3s",
|
||
"Limit": 1
|
||
}
|
||
//{
|
||
// "Endpoint": "*",
|
||
// //时间段,格式:{数字}{单位};可使用单位:s, m, h, d
|
||
// "Period": "1s",
|
||
// "Limit": 2
|
||
//}
|
||
//{
|
||
// "Endpoint": "*",
|
||
// "Period": "15m",
|
||
// "Limit": 100
|
||
//},
|
||
//{
|
||
// "Endpoint": "*",
|
||
// "Period": "12h",
|
||
// "Limit": 1000
|
||
//},
|
||
//{
|
||
// "Endpoint": "*",
|
||
// "Period": "7d",
|
||
// "Limit": 10000
|
||
//}
|
||
],
|
||
"IpRateLimitPolicies": {
|
||
//ip规则
|
||
"IpRules": [
|
||
]
|
||
}
|
||
}
|
||
}
|