appsettings.json 4.0 KB

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