mm_os 1.6.3 → 1.6.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.
- package/core/com/plugin/index.js +18 -9
- package/package.json +1 -1
package/core/com/plugin/index.js
CHANGED
|
@@ -76,14 +76,23 @@ Plugin.prototype.chat = async function(from_user, to_user, group, content, type,
|
|
|
76
76
|
Plugin.prototype.exec = function(name, method, option) {
|
|
77
77
|
var ret = "";
|
|
78
78
|
var lt = this.list;
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
if (name) {
|
|
80
|
+
for (var i = 0, o; o = lt[i++];) {
|
|
81
|
+
var name = o.config.name;
|
|
82
|
+
if (o.config.state === 1 && name === name) {
|
|
83
|
+
if (o[method]) {
|
|
84
|
+
ret = o[method](option);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
for (var i = 0, o; o = lt[i++];) {
|
|
91
|
+
if (o.config.state === 1) {
|
|
92
|
+
if (o[method]) {
|
|
93
|
+
ret = o[method](option);
|
|
94
|
+
}
|
|
85
95
|
}
|
|
86
|
-
break;
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
return ret;
|
|
@@ -151,7 +160,7 @@ if (!$.pool.plugin) {
|
|
|
151
160
|
* @param {string} title 标题
|
|
152
161
|
* @return {Object} 返回一个缓存类
|
|
153
162
|
*/
|
|
154
|
-
$.plugin_admin = function
|
|
163
|
+
$.plugin_admin = function(scope, title) {
|
|
155
164
|
if (!scope) {
|
|
156
165
|
scope = $.val.scope + '';
|
|
157
166
|
}
|
|
@@ -161,4 +170,4 @@ $.plugin_admin = function (scope, title) {
|
|
|
161
170
|
obj = $.pool.plugin[scope];
|
|
162
171
|
}
|
|
163
172
|
return obj;
|
|
164
|
-
}
|
|
173
|
+
}
|