befly 3.17.14 → 3.17.16
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/configs/beflyMenus.json +5 -5
- package/lib/logger.js +3 -3
- package/package.json +2 -2
- package/sql/befly.sql +1 -0
- package/sync/api.js +2 -0
- package/tables/api.json +6 -0
package/configs/beflyMenus.json
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
{
|
|
3
3
|
"name": "首页",
|
|
4
4
|
"path": "/",
|
|
5
|
-
"sort":
|
|
5
|
+
"sort": 0
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "人员管理",
|
|
9
9
|
"path": "/people",
|
|
10
|
-
"sort":
|
|
10
|
+
"sort": 9000,
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "管理员",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
{
|
|
20
20
|
"name": "权限设置",
|
|
21
21
|
"path": "/permission",
|
|
22
|
-
"sort":
|
|
22
|
+
"sort": 9001,
|
|
23
23
|
"children": [
|
|
24
24
|
{
|
|
25
25
|
"name": "角色管理",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
{
|
|
42
42
|
"name": "配置管理",
|
|
43
43
|
"path": "/config",
|
|
44
|
-
"sort":
|
|
44
|
+
"sort": 9002,
|
|
45
45
|
"children": [
|
|
46
46
|
{
|
|
47
47
|
"name": "字典类型",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
{
|
|
64
64
|
"name": "日志管理",
|
|
65
65
|
"path": "/log",
|
|
66
|
-
"sort":
|
|
66
|
+
"sort": 9003,
|
|
67
67
|
"children": [
|
|
68
68
|
{
|
|
69
69
|
"name": "登录日志",
|
package/lib/logger.js
CHANGED
|
@@ -132,7 +132,7 @@ class LogFileSink {
|
|
|
132
132
|
this.scheduledTimer = setTimeout(() => {
|
|
133
133
|
// timer 触发时先清空句柄,避免 flush 内再次 schedule 时被认为“已安排”。
|
|
134
134
|
this.scheduledTimer = null;
|
|
135
|
-
|
|
135
|
+
this.flush();
|
|
136
136
|
}, this.flushDelayMs);
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -220,7 +220,7 @@ class LogFileSink {
|
|
|
220
220
|
this.stream.on("error", (error) => {
|
|
221
221
|
safeWriteStderr(`[Logger] file sink error (${this.prefix}): ${error?.message || error}`);
|
|
222
222
|
this.disabled = true;
|
|
223
|
-
|
|
223
|
+
this.closeStream();
|
|
224
224
|
});
|
|
225
225
|
} catch (error) {
|
|
226
226
|
safeWriteStderr(`[Logger] createWriteStream failed (${this.prefix}): ${error?.message || error}`);
|
|
@@ -349,7 +349,7 @@ function ensureLogDirExists() {
|
|
|
349
349
|
*/
|
|
350
350
|
export function configure(cfg) {
|
|
351
351
|
// 旧实例可能仍持有文件句柄;这里异步关闭(不阻塞主流程)
|
|
352
|
-
|
|
352
|
+
shutdown();
|
|
353
353
|
|
|
354
354
|
// 方案B:每次 configure 都从默认配置重新构建(避免继承上一次配置造成测试/运行时污染)
|
|
355
355
|
config = Object.assign(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly",
|
|
3
|
-
"version": "3.17.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.17.16",
|
|
4
|
+
"gitHead": "9c4e8e90df43d744fb03b2ae473a2a566a19eee2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly - 为 Bun 专属打造的 JavaScript API 接口框架核心引擎",
|
|
7
7
|
"keywords": [
|
package/sql/befly.sql
CHANGED
|
@@ -23,6 +23,7 @@ CREATE TABLE IF NOT EXISTS `befly_api` (
|
|
|
23
23
|
`auth` VARCHAR(200) NOT NULL DEFAULT '',
|
|
24
24
|
`path` VARCHAR(200) NOT NULL DEFAULT '',
|
|
25
25
|
`parent_path` VARCHAR(200) NOT NULL DEFAULT '',
|
|
26
|
+
`method` VARCHAR(20) NOT NULL DEFAULT '',
|
|
26
27
|
`state` TINYINT NOT NULL DEFAULT 1,
|
|
27
28
|
`created_at` BIGINT NOT NULL DEFAULT 0,
|
|
28
29
|
`updated_at` BIGINT NOT NULL DEFAULT 0,
|
package/sync/api.js
CHANGED
|
@@ -57,6 +57,7 @@ export async function syncApi(ctx, apis) {
|
|
|
57
57
|
data: {
|
|
58
58
|
name: api.name,
|
|
59
59
|
path: api.apiPath,
|
|
60
|
+
method: api.method,
|
|
60
61
|
parentPath: parentPath,
|
|
61
62
|
auth: auth
|
|
62
63
|
}
|
|
@@ -67,6 +68,7 @@ export async function syncApi(ctx, apis) {
|
|
|
67
68
|
insList.push({
|
|
68
69
|
name: api.name,
|
|
69
70
|
path: api.apiPath,
|
|
71
|
+
method: api.method,
|
|
70
72
|
parentPath: parentPath,
|
|
71
73
|
auth: auth
|
|
72
74
|
});
|