appsettings.json 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. {
  2. "Sers": {
  3. /* 通讯层配置 */
  4. "CL": {
  5. /* one conn is one channel.can be multiable */
  6. "Client": [
  7. {
  8. // Socket.Iocp
  9. /* (x.1) type - Iocp */
  10. /* the class of builder in assemblyFile */
  11. "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
  12. /* (x.2) conn config */
  13. /* 服务端 host地址。例如: "127.0.0.1"、"sersms.com" */
  14. "host": "127.0.0.1",
  15. /* 服务端 监听端口号。例如: 4501 */
  16. "port": 4501,
  17. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  18. "secretKey": "SersCL"
  19. }
  20. ]
  21. },
  22. /* ServiceStation配置,可不指定 */
  23. "ServiceStation": {
  24. /* serviceStation站点信息 */
  25. "serviceStationInfo": {
  26. "serviceStationName": "Gover"
  27. }
  28. },
  29. /* 网关配置 */
  30. "Gateway": {
  31. /* Rpc配置,可不指定 */
  32. "Rpc": {
  33. /* 网关转发的请求中的rpc 信息中的 CallerSource。(暗指调用来源,默认"OutSide") */
  34. "CallerSource": "Internal"
  35. },
  36. "WebHost": {
  37. /* url,可多个 */
  38. "urls": [ "http://*:4581" ],
  39. /* http回应中的默认Content-Type。若不指定则默认为 "application/json; charset="+Serialization.Instance.charset */
  40. "//ResponseDefaultContentType": "application/json; charset=UTF-8",
  41. /* 静态文件路径。可为相对路径或绝对路径。若为空字符串则默认为当前目录下的wwwroot文件夹。若不指定(null)则不映射静态文件。 */
  42. "wwwroot": ""
  43. },
  44. //调用api前的事件,可不指定
  45. "BeforeCallApi": [
  46. {
  47. //Bearer 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),并作为参数调用接口api_verifyAt,把返回数据放到 rpcData.user.userInfo
  48. //"className": "Bearer",
  49. /* 验证at接口的地址 */
  50. "api_verifyAt": "/AuthCenter/account/verifyAt",
  51. /* 验证at接口的httpMethod。(如 GET POST 可不指定) */
  52. "api_httpMethod": "POST"
  53. },
  54. {
  55. //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
  56. "className": "AccountInCookie",
  57. "account": [
  58. {
  59. "userToken": "admin_123456",
  60. "CallerSource": "Internal",
  61. "//userInfo": {
  62. "name": "系统维护员"
  63. }
  64. },
  65. {
  66. "userToken": "order_123456",
  67. //"CallerSource": "Internal",
  68. "userInfo": {
  69. "name": "订单报表查看员",
  70. "role": "订单报表查看员",
  71. "入口": "Gover网关"
  72. }
  73. }
  74. ]
  75. }
  76. ],
  77. /* 服务限流配置,可不指定 */
  78. "//rateLimit": [
  79. {
  80. /* 服务限流key,标识一个限流服务,必须唯一 */
  81. "rateLimitKey": "rate",
  82. /* 固定时间窗口限流。在单位时间(msInterval)内限制最大请求数量为reqLimit。超出数量的请求将被拒绝 */
  83. "rateLimitType": "FixedWindow",
  84. /* 单位时间内最大请求数量(个)*/
  85. "reqLimit": 100000,
  86. /* 单位时间长度(单位:ms)*/
  87. "msInterval": 1000
  88. }
  89. ]
  90. }
  91. },
  92. /* Vit工具配置,可不指定 */
  93. "Vit": {
  94. /* 日志配置,可不指定 */
  95. "Logger": {
  96. /* print the log to console. default:false */
  97. "PrintToConsole": true
  98. },
  99. /* 序列化配置,可不指定 */
  100. "Serialization": {
  101. /* 序列化字符编码。可不指定,默认 UTF8。只可为 UTF7,UTF8,UTF32,ASCII,Unicode。 */
  102. "Encoding": "UTF8",
  103. /* 时间序列化格式。可不指定,默认 "yyyy-MM-dd HH:mm:ss" */
  104. "DateTimeFormat": "yyyy-MM-dd HH:mm:ss"
  105. },
  106. "Kestrel": {
  107. /* the maximum allowed size of any request body in bytes. When set to null, the maximum request body size is unlimited. */
  108. "//MaxRequestBodySize": 100000000
  109. }
  110. }
  111. }