Commit 8138897c by 朱建香

绑定门锁优化

parent 282d416f
......@@ -18,8 +18,8 @@ const iot = new UIOT({
},
cloud: {
// url: 'http://wx.iotface.com'
// url: 'http://192.168.2.96:20000'
url: 'https://cloud.iot.u-gen.net/test-openapi/'
url: 'http://192.168.2.96:20000'
// url: 'https://cloud.iot.u-gen.net/test-openapi/'
},
plugin: {
log: {
......
......@@ -205,7 +205,7 @@ function connectButtonTap(self){
deviceId = parameters.sn;
}
let productId = config.mode.substr(config.mode_type.length, 6);
if(response.data == "joined success"){
if(response.data == "joined success" && response.info != {}){
//云端绑定
// unBind(self, deviceId, productId);
bind(self, deviceId, productId);
......
......@@ -83,7 +83,10 @@ function init() {
success: (response) => {
console.log(response);
let data = response.data;
setDevceInfo(self, data.params.data);
console.log(data);
// if(data.hasOwnProperty('params')){
setDevceInfo(self, data.params.data);
// }
},
error: (error) => {
console.log(error);
......
......@@ -9521,8 +9521,8 @@ var iot = new UIOT({
},
cloud: {
// url: 'http://wx.iotface.com'
// url: 'http://192.168.2.96:20000'
url: 'https://cloud.iot.u-gen.net/test-openapi/'
url: 'http://192.168.2.96:20000'
// url: 'https://cloud.iot.u-gen.net/test-openapi/'
},
plugin: {
log: {
......
......@@ -221,7 +221,7 @@ function connectButtonTap(self) {
deviceId = parameters.sn;
}
var productId = _config2.default.mode.substr(_config2.default.mode_type.length, 6);
if (response.data == "joined success") {
if (response.data == "joined success" && response.info != {}) {
//云端绑定
// unBind(self, deviceId, productId);
bind(self, deviceId, productId);
......
......@@ -15972,7 +15972,10 @@ function init() {
success: function success(response) {
console.log(response);
var data = response.data;
console.log(data);
// if(data.hasOwnProperty('params')){
setDevceInfo(self, data.params.data);
// }
},
error: function error(_error2) {
console.log(_error2);
......
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