befly 3.62.0 → 3.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/auth/login.js +65 -13
- package/apis/tongJi/_tongJi.js +92 -41
- package/apis/tongJi/dailyReport.js +73 -51
- package/apis/tongJi/dailyReportSelect.js +36 -0
- package/apis/tongJi/dailyStats.js +114 -126
- package/apis/tongJi/dailyStatsDistribution.js +86 -0
- package/apis/tongJi/errorList.js +5 -9
- package/apis/tongJi/errorReport.js +81 -44
- package/apis/tongJi/errorStats.js +19 -125
- package/apis/tongJi/projectDelete.js +20 -0
- package/apis/tongJi/projectInsert.js +35 -0
- package/apis/tongJi/projectSelect.js +31 -0
- package/apis/tongJi/projectUpdate.js +52 -0
- package/configs/beflyMenus.json +20 -3
- package/index.js +5 -6
- package/lib/logger.js +20 -15
- package/package.json +1 -1
- package/plugins/cron.js +96 -0
- package/sql/befly.sql +67 -25
- package/tables/dailyReport.json +124 -0
- package/tables/errorReport.json +31 -48
- package/tables/loginLog.json +29 -32
- package/tables/project.json +42 -0
- package/utils/is.js +3 -36
- package/utils/userAgent.js +229 -104
- package/apis/tongJi/_daily.js +0 -159
package/sql/befly.sql
CHANGED
|
@@ -31,6 +31,33 @@ CREATE TABLE IF NOT EXISTS `befly_api` (
|
|
|
31
31
|
PRIMARY KEY (`id`)
|
|
32
32
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
33
33
|
|
|
34
|
+
CREATE TABLE IF NOT EXISTS `befly_daily_report` (
|
|
35
|
+
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
|
36
|
+
`report_time` BIGINT NOT NULL DEFAULT 0,
|
|
37
|
+
`report_date` INT NOT NULL DEFAULT 0,
|
|
38
|
+
`member_type` VARCHAR(6) NOT NULL DEFAULT '',
|
|
39
|
+
`member` VARCHAR(500) NOT NULL DEFAULT '',
|
|
40
|
+
`user_id` BIGINT NOT NULL DEFAULT 0,
|
|
41
|
+
`client_id` VARCHAR(120) NOT NULL DEFAULT '',
|
|
42
|
+
`ip` VARCHAR(50) NOT NULL DEFAULT '',
|
|
43
|
+
`client_type` VARCHAR(20) NOT NULL DEFAULT '',
|
|
44
|
+
`product_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
45
|
+
`product_code` VARCHAR(100) NOT NULL DEFAULT '',
|
|
46
|
+
`product_version` VARCHAR(50) NOT NULL DEFAULT '',
|
|
47
|
+
`client_version` VARCHAR(100) NOT NULL DEFAULT '',
|
|
48
|
+
`os` VARCHAR(100) NOT NULL DEFAULT '',
|
|
49
|
+
`system` VARCHAR(100) NOT NULL DEFAULT '',
|
|
50
|
+
`brand` VARCHAR(100) NOT NULL DEFAULT '',
|
|
51
|
+
`model` VARCHAR(100) NOT NULL DEFAULT '',
|
|
52
|
+
`state` TINYINT NOT NULL DEFAULT 1,
|
|
53
|
+
`created_at` BIGINT NOT NULL DEFAULT 0,
|
|
54
|
+
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
|
55
|
+
`deleted_at` BIGINT NULL DEFAULT NULL,
|
|
56
|
+
PRIMARY KEY (`id`),
|
|
57
|
+
UNIQUE KEY `uk_befly_daily_report_report_date_member` (`report_date`, `member`),
|
|
58
|
+
KEY `idx_befly_daily_report_report_date_product_code` (`report_date`, `product_code`)
|
|
59
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
60
|
+
|
|
34
61
|
CREATE TABLE IF NOT EXISTS `befly_dict` (
|
|
35
62
|
`id` BIGINT NOT NULL,
|
|
36
63
|
`type_code` VARCHAR(50) NOT NULL DEFAULT '',
|
|
@@ -100,21 +127,20 @@ CREATE TABLE IF NOT EXISTS `befly_file` (
|
|
|
100
127
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
101
128
|
|
|
102
129
|
CREATE TABLE IF NOT EXISTS `befly_login_log` (
|
|
103
|
-
`id` BIGINT NOT NULL,
|
|
130
|
+
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
|
104
131
|
`admin_id` BIGINT NOT NULL DEFAULT 0,
|
|
105
132
|
`username` VARCHAR(50) NOT NULL DEFAULT '',
|
|
106
133
|
`nickname` VARCHAR(50) NOT NULL DEFAULT '',
|
|
107
134
|
`ip` VARCHAR(50) NOT NULL DEFAULT '',
|
|
108
|
-
`
|
|
109
|
-
`
|
|
110
|
-
`
|
|
111
|
-
`
|
|
112
|
-
`
|
|
113
|
-
`
|
|
114
|
-
`
|
|
115
|
-
`
|
|
116
|
-
`
|
|
117
|
-
`cpu_architecture` VARCHAR(20) NOT NULL DEFAULT '',
|
|
135
|
+
`client_type` VARCHAR(20) NOT NULL DEFAULT '',
|
|
136
|
+
`product_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
137
|
+
`product_code` VARCHAR(100) NOT NULL DEFAULT '',
|
|
138
|
+
`product_version` VARCHAR(50) NOT NULL DEFAULT '',
|
|
139
|
+
`client_version` VARCHAR(100) NOT NULL DEFAULT '',
|
|
140
|
+
`os` VARCHAR(100) NOT NULL DEFAULT '',
|
|
141
|
+
`system` VARCHAR(100) NOT NULL DEFAULT '',
|
|
142
|
+
`brand` VARCHAR(100) NOT NULL DEFAULT '',
|
|
143
|
+
`model` VARCHAR(100) NOT NULL DEFAULT '',
|
|
118
144
|
`login_time` BIGINT NOT NULL DEFAULT 0,
|
|
119
145
|
`login_result` TINYINT NOT NULL DEFAULT 0,
|
|
120
146
|
`fail_reason` VARCHAR(200) NOT NULL DEFAULT '',
|
|
@@ -122,7 +148,8 @@ CREATE TABLE IF NOT EXISTS `befly_login_log` (
|
|
|
122
148
|
`created_at` BIGINT NOT NULL DEFAULT 0,
|
|
123
149
|
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
|
124
150
|
`deleted_at` BIGINT NULL DEFAULT NULL,
|
|
125
|
-
PRIMARY KEY (`id`)
|
|
151
|
+
PRIMARY KEY (`id`),
|
|
152
|
+
KEY `idx_befly_login_log_login_time` (`login_time`)
|
|
126
153
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
127
154
|
|
|
128
155
|
CREATE TABLE IF NOT EXISTS `befly_menu` (
|
|
@@ -194,13 +221,19 @@ CREATE TABLE IF NOT EXISTS `befly_sys_config` (
|
|
|
194
221
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
195
222
|
|
|
196
223
|
CREATE TABLE IF NOT EXISTS `befly_error_report` (
|
|
197
|
-
`id` BIGINT NOT NULL,
|
|
224
|
+
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
|
198
225
|
`report_time` BIGINT NOT NULL DEFAULT 0,
|
|
199
226
|
`first_report_time` BIGINT NOT NULL DEFAULT 0,
|
|
227
|
+
`last_report_time` BIGINT NOT NULL DEFAULT 0,
|
|
200
228
|
`bucket_time` BIGINT NOT NULL DEFAULT 0,
|
|
201
229
|
`bucket_date` INT NOT NULL DEFAULT 0,
|
|
202
230
|
`hit_count` BIGINT NOT NULL DEFAULT 1,
|
|
203
|
-
`
|
|
231
|
+
`client_type` VARCHAR(20) NOT NULL DEFAULT '',
|
|
232
|
+
`client_id` VARCHAR(120) NOT NULL DEFAULT '',
|
|
233
|
+
`member_type` VARCHAR(6) NOT NULL DEFAULT '',
|
|
234
|
+
`member` VARCHAR(200) NOT NULL DEFAULT '',
|
|
235
|
+
`user_id` BIGINT NULL DEFAULT NULL,
|
|
236
|
+
`ip` VARCHAR(50) NULL DEFAULT NULL,
|
|
204
237
|
`product_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
205
238
|
`product_code` VARCHAR(100) NOT NULL DEFAULT '',
|
|
206
239
|
`product_version` VARCHAR(100) NOT NULL DEFAULT '',
|
|
@@ -208,22 +241,31 @@ CREATE TABLE IF NOT EXISTS `befly_error_report` (
|
|
|
208
241
|
`page_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
209
242
|
`error_type` VARCHAR(50) NOT NULL DEFAULT '',
|
|
210
243
|
`message` VARCHAR(500) NOT NULL DEFAULT '',
|
|
244
|
+
`extracted_message` VARCHAR(200) NOT NULL DEFAULT '',
|
|
211
245
|
`detail` TEXT NULL,
|
|
212
|
-
`user_agent` VARCHAR(500) NOT NULL DEFAULT '',
|
|
213
|
-
`browser_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
214
|
-
`browser_version` VARCHAR(100) NOT NULL DEFAULT '',
|
|
215
|
-
`os_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
216
|
-
`os_version` VARCHAR(100) NOT NULL DEFAULT '',
|
|
217
|
-
`device_type` VARCHAR(50) NOT NULL DEFAULT '',
|
|
218
|
-
`device_vendor` VARCHAR(100) NOT NULL DEFAULT '',
|
|
219
|
-
`device_model` VARCHAR(100) NOT NULL DEFAULT '',
|
|
220
|
-
`engine_name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
221
|
-
`cpu_architecture` VARCHAR(100) NOT NULL DEFAULT '',
|
|
222
246
|
`state` TINYINT NOT NULL DEFAULT 1,
|
|
223
247
|
`created_at` BIGINT NOT NULL DEFAULT 0,
|
|
224
248
|
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
|
225
249
|
`deleted_at` BIGINT NULL DEFAULT NULL,
|
|
226
250
|
PRIMARY KEY (`id`),
|
|
227
251
|
KEY `idx_befly_error_report_time` (`report_time`),
|
|
228
|
-
KEY `idx_befly_error_report_bucket_date` (`bucket_date`)
|
|
252
|
+
KEY `idx_befly_error_report_bucket_date` (`bucket_date`),
|
|
253
|
+
UNIQUE KEY `idx_befly_error_report_unique` (`bucket_date`, `error_type`, `extracted_message`, `product_code`, `member`),
|
|
254
|
+
KEY `idx_befly_error_report_bucket_date_error_type` (`bucket_date`, `error_type`),
|
|
255
|
+
KEY `idx_befly_error_report_product_code_report_time` (`product_code`, `report_time`),
|
|
256
|
+
KEY `idx_befly_error_report_error_type_report_time` (`error_type`, `report_time`)
|
|
257
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
258
|
+
|
|
259
|
+
CREATE TABLE IF NOT EXISTS `befly_project` (
|
|
260
|
+
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
|
261
|
+
`code` VARCHAR(100) NOT NULL DEFAULT '',
|
|
262
|
+
`name` VARCHAR(100) NOT NULL DEFAULT '',
|
|
263
|
+
`sort` INT NOT NULL DEFAULT 0,
|
|
264
|
+
`state` TINYINT NOT NULL DEFAULT 1,
|
|
265
|
+
`created_at` BIGINT NOT NULL DEFAULT 0,
|
|
266
|
+
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
|
267
|
+
`deleted_at` BIGINT NULL DEFAULT NULL,
|
|
268
|
+
PRIMARY KEY (`id`),
|
|
269
|
+
UNIQUE KEY `uk_befly_project_code` (`code`),
|
|
270
|
+
KEY `idx_befly_project_state` (`state`)
|
|
229
271
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": {
|
|
3
|
+
"name": "ID",
|
|
4
|
+
"input": "integer",
|
|
5
|
+
"min": 1,
|
|
6
|
+
"max": null,
|
|
7
|
+
"detail": "1"
|
|
8
|
+
},
|
|
9
|
+
"reportTime": {
|
|
10
|
+
"name": "上报时间戳",
|
|
11
|
+
"input": "number",
|
|
12
|
+
"detail": "1720875600000"
|
|
13
|
+
},
|
|
14
|
+
"reportDate": {
|
|
15
|
+
"name": "上报日期",
|
|
16
|
+
"input": "integer",
|
|
17
|
+
"detail": "20260713"
|
|
18
|
+
},
|
|
19
|
+
"memberType": {
|
|
20
|
+
"name": "成员类型",
|
|
21
|
+
"input": "enum",
|
|
22
|
+
"check": "user|client|ip",
|
|
23
|
+
"min": 2,
|
|
24
|
+
"max": 6,
|
|
25
|
+
"detail": "user"
|
|
26
|
+
},
|
|
27
|
+
"member": {
|
|
28
|
+
"name": "成员标识",
|
|
29
|
+
"input": "string",
|
|
30
|
+
"max": 500,
|
|
31
|
+
"detail": "user:42:befly-admin"
|
|
32
|
+
},
|
|
33
|
+
"userId": {
|
|
34
|
+
"name": "用户ID",
|
|
35
|
+
"input": "integer",
|
|
36
|
+
"detail": "42"
|
|
37
|
+
},
|
|
38
|
+
"clientId": {
|
|
39
|
+
"name": "客户端标识",
|
|
40
|
+
"input": "string",
|
|
41
|
+
"max": 120,
|
|
42
|
+
"detail": "1691234567890-a1b2c3d4"
|
|
43
|
+
},
|
|
44
|
+
"ip": {
|
|
45
|
+
"name": "IP地址",
|
|
46
|
+
"input": "string",
|
|
47
|
+
"max": 50,
|
|
48
|
+
"detail": "192.168.1.1"
|
|
49
|
+
},
|
|
50
|
+
"clientType": {
|
|
51
|
+
"name": "客户端类型",
|
|
52
|
+
"input": "enum",
|
|
53
|
+
"check": "browser|vscode|desktop|miniapp|app",
|
|
54
|
+
"min": 3,
|
|
55
|
+
"max": 20,
|
|
56
|
+
"detail": "browser"
|
|
57
|
+
},
|
|
58
|
+
"productName": {
|
|
59
|
+
"name": "产品名称",
|
|
60
|
+
"input": "string",
|
|
61
|
+
"max": 100,
|
|
62
|
+
"detail": "Befly 后台管理"
|
|
63
|
+
},
|
|
64
|
+
"productCode": {
|
|
65
|
+
"name": "产品代号",
|
|
66
|
+
"input": "string",
|
|
67
|
+
"max": 100,
|
|
68
|
+
"detail": "befly-admin"
|
|
69
|
+
},
|
|
70
|
+
"productVersion": {
|
|
71
|
+
"name": "产品版本",
|
|
72
|
+
"input": "string",
|
|
73
|
+
"max": 50,
|
|
74
|
+
"detail": "1.2.3"
|
|
75
|
+
},
|
|
76
|
+
"clientVersion": {
|
|
77
|
+
"name": "客户端版本",
|
|
78
|
+
"input": "string",
|
|
79
|
+
"max": 100,
|
|
80
|
+
"detail": "1.90.0"
|
|
81
|
+
},
|
|
82
|
+
"os": {
|
|
83
|
+
"name": "操作系统",
|
|
84
|
+
"input": "string",
|
|
85
|
+
"max": 100,
|
|
86
|
+
"detail": "Android 14"
|
|
87
|
+
},
|
|
88
|
+
"system": {
|
|
89
|
+
"name": "系统",
|
|
90
|
+
"input": "string",
|
|
91
|
+
"max": 100,
|
|
92
|
+
"detail": "iOS 17.0"
|
|
93
|
+
},
|
|
94
|
+
"brand": {
|
|
95
|
+
"name": "设备品牌",
|
|
96
|
+
"input": "string",
|
|
97
|
+
"max": 100,
|
|
98
|
+
"detail": "Apple"
|
|
99
|
+
},
|
|
100
|
+
"model": {
|
|
101
|
+
"name": "设备型号",
|
|
102
|
+
"input": "string",
|
|
103
|
+
"max": 100,
|
|
104
|
+
"detail": "TAS-AN00"
|
|
105
|
+
},
|
|
106
|
+
"state": {
|
|
107
|
+
"name": "状态(0=已删除,1=正常,2=禁用)",
|
|
108
|
+
"input": "enumInteger",
|
|
109
|
+
"check": "0|1|2"
|
|
110
|
+
},
|
|
111
|
+
"createdAt": {
|
|
112
|
+
"name": "创建时间",
|
|
113
|
+
"input": "number",
|
|
114
|
+
"detail": "1720875600000"
|
|
115
|
+
},
|
|
116
|
+
"updatedAt": {
|
|
117
|
+
"name": "更新时间",
|
|
118
|
+
"input": "number"
|
|
119
|
+
},
|
|
120
|
+
"deletedAt": {
|
|
121
|
+
"name": "删除时间",
|
|
122
|
+
"input": "number"
|
|
123
|
+
}
|
|
124
|
+
}
|
package/tables/errorReport.json
CHANGED
|
@@ -21,15 +21,6 @@
|
|
|
21
21
|
"name": "时间桶日期",
|
|
22
22
|
"input": "number"
|
|
23
23
|
},
|
|
24
|
-
"hitCount": {
|
|
25
|
-
"name": "命中次数",
|
|
26
|
-
"input": "number"
|
|
27
|
-
},
|
|
28
|
-
"source": {
|
|
29
|
-
"name": "来源",
|
|
30
|
-
"input": "string",
|
|
31
|
-
"max": 50
|
|
32
|
-
},
|
|
33
24
|
"productName": {
|
|
34
25
|
"name": "产品名称",
|
|
35
26
|
"input": "string",
|
|
@@ -65,60 +56,52 @@
|
|
|
65
56
|
"input": "string",
|
|
66
57
|
"max": 500
|
|
67
58
|
},
|
|
59
|
+
"extractedMessage": {
|
|
60
|
+
"name": "提取的错误信息",
|
|
61
|
+
"input": "string",
|
|
62
|
+
"max": 200
|
|
63
|
+
},
|
|
68
64
|
"detail": {
|
|
69
65
|
"name": "错误详情",
|
|
70
66
|
"input": "string",
|
|
71
67
|
"max": 5000
|
|
72
68
|
},
|
|
73
|
-
"
|
|
74
|
-
"name": "
|
|
75
|
-
"input": "
|
|
76
|
-
"
|
|
69
|
+
"clientType": {
|
|
70
|
+
"name": "客户端类型",
|
|
71
|
+
"input": "enum",
|
|
72
|
+
"check": "browser|vscode|desktop|miniapp|app",
|
|
73
|
+
"min": 3,
|
|
74
|
+
"max": 20
|
|
77
75
|
},
|
|
78
|
-
"
|
|
79
|
-
"name": "
|
|
76
|
+
"clientId": {
|
|
77
|
+
"name": "客户端标识",
|
|
80
78
|
"input": "string",
|
|
81
|
-
"max":
|
|
79
|
+
"max": 120
|
|
82
80
|
},
|
|
83
|
-
"
|
|
84
|
-
"name": "
|
|
85
|
-
"input": "
|
|
86
|
-
"
|
|
81
|
+
"memberType": {
|
|
82
|
+
"name": "成员类型",
|
|
83
|
+
"input": "enum",
|
|
84
|
+
"check": "user|client|ip",
|
|
85
|
+
"min": 2,
|
|
86
|
+
"max": 6
|
|
87
87
|
},
|
|
88
|
-
"
|
|
89
|
-
"name": "
|
|
88
|
+
"member": {
|
|
89
|
+
"name": "成员标识",
|
|
90
90
|
"input": "string",
|
|
91
|
-
"max":
|
|
91
|
+
"max": 200
|
|
92
92
|
},
|
|
93
|
-
"
|
|
94
|
-
"name": "
|
|
95
|
-
"input": "
|
|
96
|
-
"max": 100
|
|
93
|
+
"userId": {
|
|
94
|
+
"name": "用户ID",
|
|
95
|
+
"input": "integer"
|
|
97
96
|
},
|
|
98
|
-
"
|
|
99
|
-
"name": "
|
|
97
|
+
"ip": {
|
|
98
|
+
"name": "IP地址",
|
|
100
99
|
"input": "string",
|
|
101
100
|
"max": 50
|
|
102
101
|
},
|
|
103
|
-
"
|
|
104
|
-
"name": "
|
|
105
|
-
"input": "
|
|
106
|
-
"max": 100
|
|
107
|
-
},
|
|
108
|
-
"deviceModel": {
|
|
109
|
-
"name": "设备型号",
|
|
110
|
-
"input": "string",
|
|
111
|
-
"max": 100
|
|
112
|
-
},
|
|
113
|
-
"engineName": {
|
|
114
|
-
"name": "引擎名称",
|
|
115
|
-
"input": "string",
|
|
116
|
-
"max": 100
|
|
117
|
-
},
|
|
118
|
-
"cpuArchitecture": {
|
|
119
|
-
"name": "CPU架构",
|
|
120
|
-
"input": "string",
|
|
121
|
-
"max": 100
|
|
102
|
+
"lastReportTime": {
|
|
103
|
+
"name": "最后上报时间",
|
|
104
|
+
"input": "number"
|
|
122
105
|
},
|
|
123
106
|
"state": {
|
|
124
107
|
"name": "状态(0=已删除,1=正常,2=禁用)",
|
package/tables/loginLog.json
CHANGED
|
@@ -25,55 +25,52 @@
|
|
|
25
25
|
"input": "string",
|
|
26
26
|
"max": 50
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"name": "
|
|
30
|
-
"input": "
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"name": "浏览器名称",
|
|
35
|
-
"input": "string",
|
|
36
|
-
"max": 50
|
|
28
|
+
"clientType": {
|
|
29
|
+
"name": "客户端类型",
|
|
30
|
+
"input": "enum",
|
|
31
|
+
"check": "browser|vscode|desktop|miniapp|app",
|
|
32
|
+
"min": 3,
|
|
33
|
+
"max": 20
|
|
37
34
|
},
|
|
38
|
-
"
|
|
39
|
-
"name": "
|
|
35
|
+
"productName": {
|
|
36
|
+
"name": "产品名称",
|
|
40
37
|
"input": "string",
|
|
41
|
-
"max":
|
|
38
|
+
"max": 100
|
|
42
39
|
},
|
|
43
|
-
"
|
|
44
|
-
"name": "
|
|
40
|
+
"productCode": {
|
|
41
|
+
"name": "产品代号",
|
|
45
42
|
"input": "string",
|
|
46
|
-
"max":
|
|
43
|
+
"max": 100
|
|
47
44
|
},
|
|
48
|
-
"
|
|
49
|
-
"name": "
|
|
45
|
+
"productVersion": {
|
|
46
|
+
"name": "产品版本",
|
|
50
47
|
"input": "string",
|
|
51
48
|
"max": 50
|
|
52
49
|
},
|
|
53
|
-
"
|
|
54
|
-
"name": "
|
|
50
|
+
"clientVersion": {
|
|
51
|
+
"name": "客户端版本",
|
|
55
52
|
"input": "string",
|
|
56
|
-
"max":
|
|
53
|
+
"max": 100
|
|
57
54
|
},
|
|
58
|
-
"
|
|
59
|
-
"name": "
|
|
55
|
+
"os": {
|
|
56
|
+
"name": "操作系统",
|
|
60
57
|
"input": "string",
|
|
61
|
-
"max":
|
|
58
|
+
"max": 100
|
|
62
59
|
},
|
|
63
|
-
"
|
|
64
|
-
"name": "
|
|
60
|
+
"system": {
|
|
61
|
+
"name": "系统",
|
|
65
62
|
"input": "string",
|
|
66
|
-
"max":
|
|
63
|
+
"max": 100
|
|
67
64
|
},
|
|
68
|
-
"
|
|
69
|
-
"name": "
|
|
65
|
+
"brand": {
|
|
66
|
+
"name": "设备品牌",
|
|
70
67
|
"input": "string",
|
|
71
|
-
"max":
|
|
68
|
+
"max": 100
|
|
72
69
|
},
|
|
73
|
-
"
|
|
74
|
-
"name": "
|
|
70
|
+
"model": {
|
|
71
|
+
"name": "设备型号",
|
|
75
72
|
"input": "string",
|
|
76
|
-
"max":
|
|
73
|
+
"max": 100
|
|
77
74
|
},
|
|
78
75
|
"loginTime": {
|
|
79
76
|
"name": "登录时间",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": {
|
|
3
|
+
"name": "ID",
|
|
4
|
+
"input": "integer",
|
|
5
|
+
"min": 1,
|
|
6
|
+
"max": null
|
|
7
|
+
},
|
|
8
|
+
"code": {
|
|
9
|
+
"name": "产品代号",
|
|
10
|
+
"input": "string",
|
|
11
|
+
"min": 1,
|
|
12
|
+
"max": 100
|
|
13
|
+
},
|
|
14
|
+
"name": {
|
|
15
|
+
"name": "产品名称",
|
|
16
|
+
"input": "string",
|
|
17
|
+
"min": 1,
|
|
18
|
+
"max": 100
|
|
19
|
+
},
|
|
20
|
+
"sort": {
|
|
21
|
+
"name": "排序",
|
|
22
|
+
"input": "number",
|
|
23
|
+
"max": 9999
|
|
24
|
+
},
|
|
25
|
+
"state": {
|
|
26
|
+
"name": "状态(0=已删除,1=正常,2=禁用)",
|
|
27
|
+
"input": "enumInteger",
|
|
28
|
+
"check": "0|1|2"
|
|
29
|
+
},
|
|
30
|
+
"createdAt": {
|
|
31
|
+
"name": "创建时间",
|
|
32
|
+
"input": "number"
|
|
33
|
+
},
|
|
34
|
+
"updatedAt": {
|
|
35
|
+
"name": "更新时间",
|
|
36
|
+
"input": "number"
|
|
37
|
+
},
|
|
38
|
+
"deletedAt": {
|
|
39
|
+
"name": "删除时间",
|
|
40
|
+
"input": "number"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/utils/is.js
CHANGED
|
@@ -346,44 +346,11 @@ export function isEmpty(value) {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
/**
|
|
349
|
-
*
|
|
349
|
+
* 判断当前进程是否为主进程。
|
|
350
|
+
* PM2 cluster 的实例 0 是主进程;未由 PM2 启动时视为主进程。
|
|
350
351
|
*/
|
|
351
352
|
export function isPrimaryProcess(env) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
const bunWorkerId = sourceEnv.BUN_WORKER_ID;
|
|
355
|
-
if (bunWorkerId !== undefined && bunWorkerId !== null) {
|
|
356
|
-
const normalizedBunWorkerId = String(bunWorkerId).trim();
|
|
357
|
-
if (normalizedBunWorkerId === "" || normalizedBunWorkerId === "0") {
|
|
358
|
-
return true;
|
|
359
|
-
}
|
|
360
|
-
const bunWorkerIdNumber = Number(normalizedBunWorkerId);
|
|
361
|
-
if (Number.isInteger(bunWorkerIdNumber) && bunWorkerIdNumber >= 0) {
|
|
362
|
-
return bunWorkerIdNumber === 0;
|
|
363
|
-
}
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
const pm2InstanceIdRaw = sourceEnv.NODE_APP_INSTANCE ?? sourceEnv.PM2_INSTANCE_ID ?? sourceEnv.pm_id;
|
|
368
|
-
if (pm2InstanceIdRaw !== undefined && pm2InstanceIdRaw !== null) {
|
|
369
|
-
const normalizedPm2InstanceId = String(pm2InstanceIdRaw).trim();
|
|
370
|
-
if (normalizedPm2InstanceId === "0") {
|
|
371
|
-
return true;
|
|
372
|
-
}
|
|
373
|
-
const pm2InstanceIdNumber = Number(normalizedPm2InstanceId);
|
|
374
|
-
if (Number.isInteger(pm2InstanceIdNumber) && pm2InstanceIdNumber >= 0) {
|
|
375
|
-
return pm2InstanceIdNumber === 0;
|
|
376
|
-
}
|
|
377
|
-
return false;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
const execMode = String(sourceEnv.exec_mode || sourceEnv.NODE_EXEC_MODE || "").toLowerCase();
|
|
381
|
-
const hasPm2Markers = sourceEnv.PM2_HOME !== undefined || sourceEnv.pm_exec_path !== undefined || sourceEnv.PM2_USAGE !== undefined || execMode.includes("cluster");
|
|
382
|
-
if (hasPm2Markers) {
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
return true;
|
|
353
|
+
return env.NODE_APP_INSTANCE === "0" || env.NODE_APP_INSTANCE === undefined;
|
|
387
354
|
}
|
|
388
355
|
|
|
389
356
|
export const isDirentDirectory = (parentDir, entry) => {
|