Commit 8138897c by 朱建香

绑定门锁优化

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