ZrAdminNetCore/ZR.Admin.WebApi/appsettings.json
不做码农 f7c6256e1b v3.8.1
2022-06-01 17:36:40 +08:00

127 lines
4.7 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"conn_db": "Data Source=LAPTOP-STKF2M8H\\SQLEXPRESS;User ID=sa;Password=zradmin123;Initial Catalog=ZrAdmin;Integrated Security=SSPI", //其他连接字符串请看官方文档
"conn_db_type": "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",
"localSavePath": "" //本地上传文件存储目录/home/website/uploads
},
//阿里云存储配置
"ALIYUN_OSS": {
"REGIONID": "cn-hangzhou",
"KEY": "XX",
"SECRET": "XX",
"bucketName": "bucketName",
"domainUrl": "http://xxx.xxx.com" //访问资源域名
},
"gen": {
"conn": "Data Source=LAPTOP-STKF2M8H\\SQLEXPRESS;User ID=sa;Password=zradmin123;Initial Catalog=ZrAdmin;Integrated Security=SSPI",
"dbType": 1, //MySql = 0, SqlServer = 1
"autoPre": true, //自动去除表前缀
"author": "admin",
"tablePrefix": "sys_", //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",
"vuePath": "" //前端代码存储路径egD:\Work\ZRAdmin-Vue3
},
//邮箱配置信息
"MailOptions": {
//发送人邮箱
"From": "", //egxxxx@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": [
]
}
}
}