appsettings.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {
  2. "Logging": {
  3. "LogLevel": {
  4. "Default": "Information",
  5. "Microsoft": "Warning",
  6. "Microsoft.Hosting.Lifetime": "Information"
  7. }
  8. },
  9. "ConnectionStrings": {
  10. "conn_db": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
  11. //"conn_db": "Data Source=39.106.7.239;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
  12. "conn_db_type": "0" //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3
  13. },
  14. "urls": "http://localhost:8888;http://192.168.137.1:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
  15. "corsUrls": "http://localhost:8887", //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
  16. "JwtSettings": {
  17. "Issuer": "ZRAdmin.NET",
  18. "Audience": "ZRAdmin.NET",
  19. "SecretKey": "SecretKey-ZRADMIN.NET-20210101",
  20. "Expire": 1440 //jwt登录过期时间(分)
  21. },
  22. "InitDb": false, //是否初始化db
  23. "DemoMode": false, //是否演示模式
  24. "Upload": {
  25. "uploadUrl": "http://localhost:8888", //本地存储资源访问路径
  26. "localSavePath": "uploads", //本地上传默认文件存储目录 wwwroot/uploads
  27. "maxSize": 15, //上传文件大小限制 15M
  28. "notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ]
  29. },
  30. //阿里云存储配置
  31. "ALIYUN_OSS": {
  32. "REGIONID": "", //eg:cn-hangzhou
  33. "KEY": "XX",
  34. "SECRET": "XX",
  35. "bucketName": "bucketName",
  36. "domainUrl": "http://xxx.xxx.com", //访问资源域名
  37. "maxSize": 100 //上传文件大小限制 100M
  38. },
  39. //企业微信通知配置
  40. "WxCorp": {
  41. "AgentID": "",
  42. "CorpID": "",
  43. "CorpSecret": "",
  44. "SendUser": "@all"
  45. },
  46. "gen": {
  47. "conn": "Data Source=localhost;port=3306;User ID=sa;Password=sa123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
  48. //"conn": "Data Source=39.106.7.239;port=3306;User ID=sa;Password=123456;Database=mytest_db;CharSet=utf8;sslmode=none;",
  49. "dbType": 0, //MySql = 0, SqlServer = 1
  50. "autoPre": true, //自动去除表前缀
  51. "author": "admin",
  52. "tablePrefix": "sys_", //"表前缀(生成类名不会包含表前缀,多个用逗号分隔)",
  53. "vuePath": "" //前端代码存储路径eg:D:\Work\ZRAdmin-Vue3
  54. },
  55. //邮箱配置信息
  56. "MailOptions": {
  57. //发送人邮箱
  58. "From": "", //eg:xxxx@qq.com
  59. //发送人邮箱密码
  60. "Password": "123456",
  61. //协议
  62. "Smtp": "smtp.qq.com",
  63. "Port": 587,
  64. "Signature": "系统邮件,请勿回复!"
  65. },
  66. //redis服务配置
  67. "RedisServer": {
  68. "Cache": "127.0.0.1:6379,defaultDatabase=0,poolsize=50,ssl=false,writeBuffer=10240,prefix=cache:",
  69. "Session": "127.0.0.1:6379,defaultDatabase=0,poolsize=50,ssl=false,writeBuffer=10240,prefix=session:"
  70. },
  71. //接口请求限制
  72. "IpRateLimiting": {
  73. "EnableEndpointRateLimiting": true,
  74. "StackBlockedRequests": false,
  75. "RealIpHeader": "X-Real-IP",
  76. "ClientIdHeader": "X-ClientId",
  77. "HttpStatusCode": 429,
  78. "EndpointWhitelist": [ "post:/system/dict/data/types", "*:/msghub/negotiate", "*:/LogOut", "*:/common/uploadfile" ],
  79. "QuotaExceededResponse": {
  80. "Content": "{{\"code\":429,\"msg\":\"访问过于频繁,请稍后重试\"}}",
  81. "ContentType": "application/json",
  82. "StatusCode": 429
  83. },
  84. //通用规则,api规则,结尾一定要带*
  85. "GeneralRules": [
  86. {
  87. "Endpoint": "*:/captchaImage",
  88. //时间段,格式:{数字}{单位};可使用单位:s, m, h, d
  89. "Period": "3s",
  90. "Limit": 5
  91. },
  92. {
  93. "Endpoint": "((post)|(put)):*",
  94. "Period": "3s",
  95. "Limit": 1
  96. }
  97. ],
  98. "IpRateLimitPolicies": {
  99. //ip规则
  100. "IpRules": [
  101. ]
  102. }
  103. },
  104. //验证码配置
  105. "CaptchaOptions": {
  106. "length": 4 //验证码长度
  107. }
  108. }