沈斌
2017-01-31 06a6dc6aba7a5ebb55ef50473b7fa165594eb004
method.js
@@ -172,29 +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 = {
            mac: mac,
            address: "江苏省昆山市摩瑞尔电器",
            location: {
                lat:31.430616,
                lng:120.988327
            },
            notice: {
                tel: "15950198162",
                email: "it01@moral.org.cn",
                open_id: "o-RTuwvMHWotyirPHLmdSB_dKoQU"
            },
            options: {
                1: [1000, 2000, 3000],
                2: [1000, 2000, 3000],
                3: [1000, 2000, 3000],
                4: [1000, 2000, 3000],
                5: [1000, 2000, 3000]
            }
        };
        configs[mac] = _config;
        _config = config.ALARM_DEFAULTS;
        _config.mac = mac;
        global.configs[mac] = _config;
    }
    console.log("----------------------2")
    console.log(_config)
    var current = moment();
@@ -388,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