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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
| {
| "urls": "http://*:9291",
| // ==================== 数据库连接配置 ====================
| "DbConnection": {
| // 数据库连接字符串
| "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_TEST_Log;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
| // 数据库类型: SqlServer, MySql, SQLite, PostgreSQL
| "DbType": "SqlServer",
| // 是否启用 SQL 日志
| "EnableSqlLog": false,
| // 命令超时时间(秒)
| "CommandTimeout": 30
| },
|
| // ==================== CORS 跨域配置 ====================
| "Cors": {
| // 是否允许任何来源(true=允许所有,false=使用 AllowedOrigins 列表)
| "AllowAnyOrigin": false,
| // 允许的来源列表(当 AllowAnyOrigin 为 false 时生效)
| "AllowedOrigins": [
| "http://localhost:3000",
| "http://localhost:8080",
| "https://localhost:3000",
| "https://localhost:8080"
| ],
| // 是否允许任何 HTTP 方法(GET, POST, PUT, DELETE 等)
| "AllowAnyMethod": true,
| // 是否允许任何请求头
| "AllowAnyHeader": true,
| // 暴露给客户端的响应头
| "ExposedHeaders": [
| "X-Correlation-ID",
| "X-Request-ID"
| ],
| // 是否设置预检请求(OPTIONS)的缓存时间
| "SetPreflightMaxAge": true,
| // 预检请求的最大缓存时间(秒)
| "PreflightMaxAgeSeconds": 600
| },
|
| // ==================== Swagger API 文档配置 ====================
| "Swagger": {
| // API 文档标题
| "Title": "KH.WMS API",
| // API 版本
| "Version": "v1",
| // API 描述
| "Description": "KH.WMS API 接口文档",
| // 联系人名称
| "ContactName": "",
| // 联系人邮箱
| "ContactEmail": "",
| // 联系人 URL
| "ContactUrl": "",
| // 许可证名称
| "LicenseName": "",
| // 许可证 URL
| "LicenseUrl": "",
| // Swagger UI 访问路径前缀(空字符串表示根路径)
| "RoutePrefix": "swagger",
| // 是否启用 JWT 认证
| "EnableJwt": true
| },
|
| // ==================== MiniProfiler 性能分析配置 ====================
| "MiniProfiler": {
| // MiniProfiler 路由基础路径
| "RouteBasePath": "/profiler",
| // 是否在生产环境启用
| "EnableInProduction": false,
| // 是否跟踪数据库连接的打开/关闭
| "TrackConnectionOpenClose": true,
| // 堆栈跟踪长度
| "StackTraceLength": 5
| },
|
| // ==================== RateLimit 限流配置 ====================
| "RateLimit": {
| // 时间窗口内允许的请求数
| "RequestLimit": 100,
| // 时间窗口(秒)
| "WindowSeconds": 60,
| // 缓存键前缀
| "KeyPrefix": "ratelimit"
| },
|
| // ==================== 应用配置 ====================
| "App": {
| // 应用名称
| "AppName": "KH.WMS"
| },
|
| // ==================== Serilog 日志配置 ====================
| "Serilog": {
| // 最低日志级别
| "MinimumLevel": {
| // 默认级别: Debug, Information, Warning, Error, Fatal
| "Default": "Debug",
| // 覆盖特定命名空间的日志级别
| "Override": {
| "Microsoft": "Warning",
| "Microsoft.Hosting.Lifetime": "Information",
| "Microsoft.EntityFrameworkCore": "Warning",
| "System": "Warning"
| }
| },
| // 日志文件存储路径
| "LogPath": "Logs",
| // 日志保留天数
| "RetentionDays": 30,
| // 单个日志文件最大大小(MB)
| "MaxFileSizeMB": 5,
| // 是否输出到控制台
| "WriteToConsole": true,
| // 日志文件名配置
| "FileNames": {
| // 普通日志文件名
| "Log": "log",
| // 错误日志文件名
| "Error": "error",
| // 警告日志文件名
| "Warning": "warning"
| }
| }
| }
|
|