mm_api 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/lib/api.js +4 -1
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -322,7 +322,10 @@ Api.prototype._loadSql = function (file_path) {
322
322
  if (!cfg) {
323
323
  return null;
324
324
  }
325
- cfg.name = cfg.name || this.config.name;
325
+ // 实例名必须唯一:mm_mod 的 config 按类名+名称存入共享配置存储,
326
+ // 不同接口的 dao.json 可能同名(如多个 "cms_article"),直接沿用会互相覆盖,
327
+ // 因此强制以接口名命名 Dao 实例
328
+ cfg.name = this.config.name || cfg.name;
326
329
  cfg.config_file = p;
327
330
  cfg.dir = path.dirname(p);
328
331
  if (Dao) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_api",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "API框架,用于实现web api和mvc模式路由请求,负责配置路由路径、访问权限、校验机制;基于 mm_corejs,内置管理器池,无全局/原型扩展依赖",
5
5
  "main": "index.js",
6
6
  "keywords": [