mm_machine 1.7.9 → 1.8.0
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/index.js +3 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -334,7 +334,7 @@ Item.prototype.run = async function(method, ...params) {
|
|
|
334
334
|
try {
|
|
335
335
|
ret = this[method](...params);
|
|
336
336
|
} catch (err) {
|
|
337
|
-
$.log.error("
|
|
337
|
+
$.log.error("执行时失败!", err);
|
|
338
338
|
}
|
|
339
339
|
if (util.types.isPromise(ret)) {
|
|
340
340
|
ret = await ret;
|
|
@@ -358,7 +358,7 @@ Item.prototype.run = async function(method, ...params) {
|
|
|
358
358
|
* @param {Number} state 状态 0为不可以,1为可用
|
|
359
359
|
* @param {Array} ...params 参数集合
|
|
360
360
|
*/
|
|
361
|
-
Item.prototype.run_cmd = function(state, ...params) {
|
|
361
|
+
Item.prototype.run_cmd = async function(state, ...params) {
|
|
362
362
|
return null;
|
|
363
363
|
};
|
|
364
364
|
|
|
@@ -368,7 +368,6 @@ Item.prototype.run_cmd = function(state, ...params) {
|
|
|
368
368
|
* @param {Array} ...params 参数集合
|
|
369
369
|
*/
|
|
370
370
|
Item.prototype.cmd = function(state, ...params) {
|
|
371
|
-
this.config.state = state;
|
|
372
371
|
return this.run_cmd(state, ...param);
|
|
373
372
|
}
|
|
374
373
|
|
|
@@ -585,7 +584,7 @@ Index.prototype.cmd = async function(name, state, ...params) {
|
|
|
585
584
|
if (!obj) {
|
|
586
585
|
return "error: program does not exist";
|
|
587
586
|
}
|
|
588
|
-
return await obj.cmd
|
|
587
|
+
return await obj.run("cmd", state, ...params);
|
|
589
588
|
}
|
|
590
589
|
|
|
591
590
|
/**
|