befly 3.15.1 → 3.15.3

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  ## 运行环境
10
10
 
11
11
  - Bun >= 1.0
12
- - MySQL >= 8.0(或 PostgreSQL / SQLite)
12
+ - MySQL >= 8.0
13
13
  - Redis >= 6.0(可选,但推荐)
14
14
 
15
15
  ## 安装与启动
@@ -49,7 +49,6 @@ my-api/
49
49
  "appHost": "127.0.0.1",
50
50
 
51
51
  "db": {
52
- "dialect": "mysql",
53
52
  "host": "127.0.0.1",
54
53
  "port": 3306,
55
54
  "username": "root",
@@ -24,7 +24,7 @@ const defaultOptions = {
24
24
  },
25
25
  // ========== 数据库配置 ==========
26
26
  db: {
27
- dialect: "mysql",
27
+ idMode: "timeId",
28
28
  host: "127.0.0.1",
29
29
  port: 3306,
30
30
  username: "root",
@@ -67,7 +67,7 @@ const defaultOptions = {
67
67
  rules: []
68
68
  },
69
69
  // ========== 菜单禁用配置 ==========
70
- disableMenus: ["**/404", "**/403", "**/500", "**/login"],
70
+ disableMenus: ["**/404", "**/403", "**/500", "/addon/admin/login"],
71
71
  // ========== Addon 配置 ==========
72
72
  addons: {}
73
73
  };
@@ -94,5 +94,9 @@ export async function loadBeflyConfig(nodeEnv) {
94
94
  throw new Error(`配置错误:redis.prefix 不允许包含 ':'(RedisHelper 会自动拼接分隔符 ':'),请改为不带冒号的前缀,例如 'befly_demo',当前值=${redisPrefix}`);
95
95
  }
96
96
  }
97
+ const idMode = config.db?.idMode;
98
+ if (idMode !== undefined && idMode !== "timeId" && idMode !== "autoId") {
99
+ throw new Error(`配置错误:db.idMode 只能是 'timeId' 或 'autoId',当前值=${String(idMode)}`);
100
+ }
97
101
  return config;
98
102
  }