mm_os 3.2.0 → 3.2.2

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.
@@ -124,13 +124,14 @@ MQTT.prototype.update_after = async function() {
124
124
  var _this = this;
125
125
  var list = this.list;
126
126
  for (var i = 0; i < list.length; i++) {
127
- if (o.config.state === 1) {
127
+ var o = list[i];
128
+ if (o.config && o.config.state === 1) {
128
129
  o.send = function(topic, msg, qos = 0, retain = false) {
129
130
  if (topic) {
130
131
  _this.send(topic, msg, qos, retain);
131
132
  }
132
133
  };
133
- // await o.exec('init');
134
+ await o.exec('init');
134
135
  var topics = o.config.topic;
135
136
  if (topics) {
136
137
  for (var n = 0; n < topics.length; n++) {
@@ -265,14 +266,15 @@ MQTT.prototype.receive = async function(push_topic, msg) {
265
266
  }
266
267
  var ret;
267
268
  var list = this.list;
268
- for (var i = 0, o; o = list[i++];) {
269
+ for (var i = 0; i < list.length; i++) {
270
+ var o = list[i];
269
271
  if (o.config.state === 1) {
270
272
  var topics = o.config.topic;
271
273
  if (topics) {
272
- for (var i = 0; i < topics.length; i++) {
273
- var topic = topics[i];
274
+ for (var n = 0; n < topics.length; n++) {
275
+ var topic = topics[n];
274
276
  if (this.match(push_topic, topic)) {
275
- ret = await o.exec('handle', push_topic, msg, topic, i);
277
+ ret = await o.exec('handle', push_topic, msg, topic, n);
276
278
  }
277
279
  }
278
280
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_os",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "这是超级美眉服务端框架,用于快速构建应用程序。",
5
5
  "main": "index.js",
6
6
  "scripts": {