mm_power 1.0.2 → 1.0.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 +10 -1
- package/index.js +8 -7
- package/lib/power.js +1969 -0
- package/lib/tools/index.js +16 -0
- package/lib/tools/power/index.js +62 -0
- package/package.json +58 -55
- package/tool/power/index.js +7 -0
- package/tool/power/tool.json +76 -0
package/README.md
CHANGED
|
@@ -381,4 +381,13 @@ mm_power鉴权模块经过全面的功能验证,完全满足您的需求:
|
|
|
381
381
|
|
|
382
382
|
---
|
|
383
383
|
|
|
384
|
-
查看更多使用示例,请查看 [EXAMPLES.md](EXAMPLES.md) 文件。
|
|
384
|
+
查看更多使用示例,请查看 [EXAMPLES.md](EXAMPLES.md) 文件。
|
|
385
|
+
|
|
386
|
+
## 工具契约(LLM 可调用)
|
|
387
|
+
|
|
388
|
+
本模块 `tool/` 下登记以下工具契约,实现位于 `lib/tools/<name>/`,`tool/<name>/index.js` 仅为薄适配层。
|
|
389
|
+
其它模块可直接 `require('<pkg>').tools.<name>` 复用实现,无需经过工具注册面。
|
|
390
|
+
|
|
391
|
+
| 工具名 | 标题 | 说明 |
|
|
392
|
+
| --- | --- | --- |
|
|
393
|
+
| `power` | RBAC 权限校验 | 管理组/字段等级/综合权限校验 |
|
package/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { reg } = require('mm_admin');
|
|
2
2
|
const Power = require('./lib/power.js');
|
|
3
3
|
|
|
4
|
-
const admin =
|
|
4
|
+
const admin = reg('mm_power');
|
|
5
5
|
admin.setClass(Power);
|
|
6
6
|
|
|
7
7
|
module.exports = {
|
|
8
8
|
Power,
|
|
9
9
|
admin,
|
|
10
10
|
powerAdmin(scope, config) {
|
|
11
|
-
|
|
12
|
-
scope = 'os';
|
|
13
|
-
}
|
|
14
|
-
return admin.get(scope, config);
|
|
11
|
+
return admin.get(scope || 'os', config);
|
|
15
12
|
},
|
|
16
13
|
getPower() {
|
|
17
14
|
return admin.get('os');
|
|
18
15
|
}
|
|
19
|
-
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* mm-tool-logic-export 工具能力层:其它模块可 require("mm_power").tools.<name> 直接引用 */
|
|
19
|
+
Object.defineProperty(module.exports, 'tools', { enumerable: true, configurable: true,
|
|
20
|
+
get: function () { return require('./lib/tools'); } });
|