fetch api with macAddr

This commit is contained in:
life
2018-12-11 17:46:43 +08:00
parent ec6ab9efdb
commit e73f853c41

7
node_modules/api.js generated vendored
View File

@@ -10,6 +10,7 @@ var Tags = db.tags;
var needle = require('needle');
var fs = require('fs');
var Evt = require('evt');
var macAddr = require('node-getmac');
function log(o) {
// console.log(o);
@@ -115,7 +116,7 @@ var Api = {
// log({emai: email, pwd: pwd});
// console.log(this.getUrl('auth/login', {email: email, pwd: pwd}));
// console.log('????????????')
needle.post(this.getUrl('auth/login'), {email: email, pwd: pwd}, {timeout: 10000}, function(error, response) {
needle.post(this.getUrl('auth/login', {macAddr: macAddr}), {email: email, pwd: pwd}, {timeout: 10000}, function(error, response) {
me.checkError(error, response);
if(error) {
return callback && callback(false);
@@ -139,7 +140,7 @@ var Api = {
},
logout: function (callback) {
needle.post(this.getUrl('auth/logout'), {timeout: 10000}, function(error, response) {
needle.post(this.getUrl('auth/logout', {macAddr: macAddr}), {timeout: 10000}, function(error, response) {
callback();
});
},
@@ -206,7 +207,7 @@ var Api = {
},
getLastSyncState: function(callback) {
var me = this;
var url = this.getUrl('user/getSyncState');
var url = this.getUrl('user/getSyncState', {macAddr: macAddr});
// console.log(url);
needle.get(url, {timeout: 10000}, function(error, response) {
// console.log('user/getSyncState ret');