From 06a6dc6aba7a5ebb55ef50473b7fa165594eb004 Mon Sep 17 00:00:00 2001
From: 沈斌 <23420800@qq.com>
Date: Tue, 31 Jan 2017 15:45:28 +0800
Subject: [PATCH] 修复json config中notice问题

---
 method.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/method.js b/method.js
index cdbe1e8..1480ee3 100644
--- a/method.js
+++ b/method.js
@@ -172,11 +172,18 @@
     var mcu = this.toDec(fields[64]) + this.toDec(fields[65]) / 100;
 
     var _config = global.configs[mac];
+
+    console.log("----------------------1")
+    console.log(_config)
+
     if(_config == null) {
         _config = config.ALARM_DEFAULTS;
         _config.mac = mac;
-        configs[mac] = _config;
+        global.configs[mac] = _config;
     }
+
+    console.log("----------------------2")
+    console.log(_config)
 
     var current = moment();
 
@@ -370,7 +377,7 @@
                 var userID = doc.userID;
                 db.collection("users").find({"_id": userID}).limit(1).next(function(err, user){
                     if(user) {
-                        config[notice] = {
+                        config["notice"] = {
                             tel: user.username,
                             email: user.email,
                             open_id: user.open_id

--
Gitblit v1.8.0