Commit 5f73e514 by zCaesar

fix auth regis

parent aac8e7d2
...@@ -30,8 +30,7 @@ function authCheck(client_id, token, password, callback) { ...@@ -30,8 +30,7 @@ function authCheck(client_id, token, password, callback) {
console.log('token :' + token) console.log('token :' + token)
seneca.act('ms:tokenregistry, cmd:getAttributes, type:device, tokencode:' + token, function (err, res) { seneca.act('ms:tokenregistry, cmd:getAttributes, type:device, tokencode:' + token, function (err, res) {
console.log('result : ' + util.inspect(res.result, false, null, true)) console.log('result : ' + util.inspect(res.result, false, null, true))
if (res.result.length > 0) { if (res.result) {
console.log(res.result)
var token_profile = (res && res.result) ? res.result : {}; var token_profile = (res && res.result) ? res.result : {};
var mqttauth = { var mqttauth = {
clientid: client_id, clientid: client_id,
......
...@@ -25,7 +25,7 @@ module.exports.auth_connect = auth_connect ...@@ -25,7 +25,7 @@ module.exports.auth_connect = auth_connect
} }
*/ */
function auth_connect(mqttauth, token_profile) { function auth_connect(mqttauth, token_profile) {
console.log('auth_connect')
var dateNow = Math.floor(Date.now() / 1000) var dateNow = Math.floor(Date.now() / 1000)
var res = { var res = {
status : true status : true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment