Last active
July 5, 2017 20:53
-
-
Save nazrdogan/d4a56d59eda8a62a6a354fb60f06745d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetAuth2Token(device) { | |
return new Promise(function(resolve, reject) { | |
QRC.setTargetIpAddress(device.ip, device.index); | |
QRC.getToken(vm.current_password ||'12345678', device.index).then(sucFn); | |
function sucFn(data) { | |
QRC.setTargetAuthToken(data.data.access_token); | |
resolve (data.data.access_token); | |
} | |
}); | |
} | |
var access_token; | |
GetAuth2Token(vm.scannedDevices[i]).then(function(data){ | |
access_token = data; | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment