mm_os 2.2.7 → 2.2.9
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/mqtt/drive.js +9 -9
- package/package.json +2 -2
package/core/com/mqtt/drive.js
CHANGED
|
@@ -312,9 +312,9 @@ Drive.prototype.pushS = function(clientid, msg, longtime) {
|
|
|
312
312
|
Drive.prototype.push = function(method, clientid, params, longtime = 0) {
|
|
313
313
|
var cg = this.config;
|
|
314
314
|
var msg = {};
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
msg[cg.msgid] = this.get_msgid(method);
|
|
316
|
+
msg[cg.method] = method;
|
|
317
|
+
msg[cg.params] = params;
|
|
318
318
|
return this.pushS(clientid, msg);
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -366,7 +366,8 @@ Drive.prototype.exec = async function(clientid, key, json) {
|
|
|
366
366
|
/**
|
|
367
367
|
* 获取客户端ID
|
|
368
368
|
* @param {String} push_topic 推送过来的主题
|
|
369
|
-
* @param {Object}
|
|
369
|
+
* @param {Object} body 消息主体
|
|
370
|
+
* @param {Object} msg 消息源
|
|
370
371
|
* @param {String} topic 订阅的主题
|
|
371
372
|
*/
|
|
372
373
|
Drive.prototype.get_clientid = function(push_topic, body, msg, topic) {
|
|
@@ -382,7 +383,7 @@ Drive.prototype.get_clientid = function(push_topic, body, msg, topic) {
|
|
|
382
383
|
/**
|
|
383
384
|
* 数据格式转换-转入
|
|
384
385
|
* @param {String} push_topic 推送过来的主题
|
|
385
|
-
* @param {Object} msg
|
|
386
|
+
* @param {Object} msg 消息源
|
|
386
387
|
* @param {Number} index 索引
|
|
387
388
|
* @param {String} topic 订阅的主题
|
|
388
389
|
*/
|
|
@@ -396,12 +397,11 @@ Drive.prototype.convert_in = function(push_topic, msg, topic, index) {
|
|
|
396
397
|
};
|
|
397
398
|
if (msg[cg.params]) {
|
|
398
399
|
json.params = msg[cg.params];
|
|
399
|
-
json.clientid = this.get_clientid(push_topic, json.params, msg, topic);
|
|
400
400
|
}
|
|
401
401
|
if (msg[cg.result]) {
|
|
402
|
-
json.result = msg[cg.result]
|
|
403
|
-
json.clientid = this.get_clientid(push_topic, json.result, msg, topic);
|
|
402
|
+
json.result = msg[cg.result];
|
|
404
403
|
}
|
|
404
|
+
json.clientid = this.get_clientid(push_topic, json.params || json.result || {}, msg, topic);
|
|
405
405
|
return json;
|
|
406
406
|
}
|
|
407
407
|
|
|
@@ -480,7 +480,7 @@ Drive.prototype.handle = async function(push_topic, msg, topic, index) {
|
|
|
480
480
|
obj[cg.result] = ret;
|
|
481
481
|
var topic_receive = this.get_topic(arr_tc[index], json.clientid, params);
|
|
482
482
|
var reply_msg = this.convert_out(topic_receive, obj, topic, index);
|
|
483
|
-
this.send(topic_receive, reply_msg);
|
|
483
|
+
await this.send(topic_receive, reply_msg);
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_os",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.9",
|
|
4
4
|
"description": "这是超级美眉服务端框架,用于快速构建应用程序。",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"mm_html": "^1.1.6",
|
|
42
42
|
"mm_koa_proxy": "^1.0.0",
|
|
43
43
|
"mm_logs": "^1.1.4",
|
|
44
|
-
"mm_machine": "^1.7.
|
|
44
|
+
"mm_machine": "^1.7.4",
|
|
45
45
|
"mm_mongodb": "^1.4.2",
|
|
46
46
|
"mm_mqtt": "^1.0.6",
|
|
47
47
|
"mm_mysql": "^1.8.0",
|