liaoxujun@qq.com
2024-03-05 f0ca9fb79a91544c037c55a291be00e8c469bf34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
  "ConnectionStrings": {
    "DbType": "SqlServer", //数据库将支持两种模式【SqlServer,MySql】
    "SqlConnection": "Server=localhost\\SQLEXPRESS;User ID=sa;Password=123456;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"
    //SqlServer数据库连接字符串,需要开启数据库连接复用【MultipleActiveResultSets=true】
 
    // 如果采用容器化部署Service 要写成mysql的服务名,否则写地址
    //"SqlConnection": "Server=127.0.0.1;Port=3306;Database=CoreShopProfessional;Uid=CoreShopProfessional;Pwd=CoreShopProfessional;CharSet=utf8;pooling=true;SslMode=None;Allow User Variables=true;Convert Zero Datetime=True;Allow Zero Datetime=True;"
    // Mysql数据库链接字符串,请保持后面的属性别少。经过测试,mysql版本需要5.7或以上
  },
  //定时任务管理面板的账户密码
  "HangFire": {
    "Login": "CoreShopProfessional", //登录账号
    "PassWord": "uzmp0o3213217vr53", //登录密码
    "JobExpirationTimeOut": "10080" //已经完成的任务过期时间,单位分钟(默认10080,7天时间)
  },
  //Swagger授权访问设置
  "SwaggerConfig": {
    "RoutePrefix": "doc", //路由地址,默认doc
    "UserName": "1111",
    "PassWord": "1111"
  },
  "AppConfig": {
    "AppUrl": "http://192.168.0.113:1987/", //后端管理地址
    "AppPcUrl": "https://pc.test.pro.coreshop.cn/", //PC端访问地址
    "AppH5Url": "https://h5.test.pro.coreshop.cn/", //H5端访问地址
    "AppInterFaceUrl": "http://192.168.0.113:2015/", //接口请求地址
    "AppVersion": "CoreShopProfessional v0.7.3"
  },
  //redis为必须启动项,请保持redis为正常可用
  "RedisConfig": {
    "UseCache": true, //启用redis作为内存选择
    "UseTimedTask": true, //启用redis作为定时任务
    // 如果采用容器化部署Service 要写成redis的服务名,否则写地址
    "ConnectionString": "127.0.0.1:6379,password=,connectTimeout=30000,responseTimeout=30000,abortConnect=false,connectRetry=1,syncTimeout=10000,DefaultDatabase=9" //redis数据库连接字符串
  },
  //jwt授权认证的一些设置
  "JwtConfig": {
    "SecretKey": "", //请自主填写一段英文数字等作为token令牌,16位+
    "Issuer": "", //颁发者身份标识,如CoreShop.Professional
    "Audience": "coreshop" //期望的接收人,如core,cms等
  },
  //跨域设置
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
    "EnableAllIPs": false, //是否应用所有的IP,如设置为true,则取消跨域限制
    // 支持多个域名端口,注意端口号后不要带/斜杆:比如localhost:8000/,是错的
    // 注意,http://127.0.0.1:1818 和 http://localhost:1818 是不一样的
    "IPs": "http://127.0.0.1:4000,http://127.0.0.1:5000,http://127.0.0.1:6000,http://localhost:4000,http://localhost:5000,http://localhost:6000"
  },
  //中间件
  "Middleware": {
    //记录请求和响应数据
    "RequestResponseLog": {
      "Enabled": false
    },
    //记录用户方访问数据
    "RecordAccessLogs": {
      "Enabled": false, //是否开启记录操作日志功能。
      "EnabledFileMode": false, //是否开启记录到文件功能。(影响效率,接口不建议开启)
      "EnabledDbMode": false, //是否开启记录到数据库模式。(影响效率,后台可开启,接口不建议开启,因为数据库会存储大量的用于请求数据和返回数据。)
      "IgnoreApis": "/api/tools/getuserinfo,/api/tools/getNavs,/api/CodeGenerator/CodeGenDown" //使用小写逗号分隔
    },
    //记录IP请求数据
    "IPLog": {
      "Enabled": false
    }
  },
  //UseRateLimiter限流中间件配置
  "MyRateLimitOptions": {
    "MyRateLimit": {
      //一个窗口中允许的最大允许计数器数。 在将这些选项传递给 的FixedWindowRateLimiter构造函数时,必须设置为值 > 0。
      "PermitLimit": 100,
      //指定请求的时间范围。 必须设置为大于 Zero 将这些选项传递给 的构造函数 FixedWindowRateLimiter时的值。
      "Window": 10,
      //当 AutoReplenishment 设置为 true 时,内部计时器每 ReplenishmentPeriod 时间补充一次令牌数;当 false 设置为 TryReplenish 时,应用必须对限制器调用 。
      "ReplenishmentPeriod": 2,
      //排队的获取请求的最大累计允许计数。 将这些选项传递给 的FixedWindowRateLimiter构造函数时,必须设置为值 >= 0。
      "QueueLimit": 2,
      "SegmentsPerWindow": 8,
      "TokenLimit": 10,
      "TokensPerPeriod": 4,
      //是否自动补货
      "AutoReplenishment": false
    }
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "WeChatOptions": {
    //公众号
    "WeiXinAppId": "",
    "WeiXinAppSecret": "",
    "WeiXinEncodingAesKey": "",
    "WeiXinToken": "",
    //小程序
    "WxOpenAppId": "wx45d700a970238807",
    "WxOpenAppSecret": "3e9e4e68695ffc62f51b5ec1d1ddf942",
    "WxOpenToken": "",
    "WxOpenEncodingAESKey": ""
  }
}