Commit e26abb1d by 朱建香

1124

parent 22735af2
......@@ -85,60 +85,60 @@ function initComponentsConfig() {
}
function loginButtonTap(self){
// uComponents.showLoading(self);
uComponents.showLoading(self);
// if(window.iotDebug){
// iotDebug.push('start: initSDSLogin');
// }
window.SDSPlugin.login({},(res)=>{
console.log(res);
var data = uPublic.checkResponseData(res.data);
// window.SDSPlugin.login({},(res)=>{
// console.log(res);
// var data = uPublic.checkResponseData(res.data);
// if(data){
// cloudsLogin(self, data.UserID);
// }
// },(err)=>{
// console.log(err);
// })
iot.business.sds.login({
data: {
userinfo: {}
},
success: (response) => {
console.log(response);
if(window.iotDebug){
iotDebug.push('end: SDSloginSuccees');
}
// console.log(response);
// alert(JSON.stringify(response));
var data = uPublic.checkResponseData(response.data);
if(data){
self.setShowLoginButtonFlag(false);
if(data.hasOwnProperty('UserID')){
console.log("sds登陆成功了");
cloudsLogin(self, data.UserID);
}
},(err)=>{
console.log(err);
})
// iot.business.sds.login({
// data: {
//// sds: true
// },
// success: (response) => {
//// console.log(response);
//// if(window.iotDebug){
//// iotDebug.push('end: SDSloginSuccees');
//// }
////// console.log(response);
////// alert(JSON.stringify(response));
//// var data = uPublic.checkResponseData(response.data);
//// if(data){
//// self.setShowLoginButtonFlag(false);
//// if(data.hasOwnProperty('UserID')){
//// console.log("sds登陆成功了");
//// cloudsLogin(self, data.UserID);
//// }
////// iot.navigator.openWindow({
////// url: '../device/index.html',
////// id: 'device'
////// });
//// }else{
////
//// }
// },
// error: (error) => {
//// console.log(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds登陆失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds登陆失败');
//// }
//// //请求失败
////// uPublic.openRequestErrorAlert(self);
// },
// complete: () => {
//// uComponents.hideLoading(self);
// }
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
}else{
}
},
error: (error) => {
console.log(error);
if(window.iotDebug){
iotDebug.push('end: sds登陆失败'+JSON.stringify(error));
}
if (window.iotDebug) {
iotDebug.upload(iot,'sds登陆失败');
}
// //请求失败
//// uPublic.openRequestErrorAlert(self);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
function cloudsLogin(self, id){
......
......@@ -93,60 +93,58 @@ function initComponentsConfig() {
}
function loginButtonTap(self) {
// uComponents.showLoading(self);
_public.uComponents.showLoading(self);
// if(window.iotDebug){
// iotDebug.push('start: initSDSLogin');
// }
window.SDSPlugin.login({}, function (res) {
console.log(res);
var data = _public.uPublic.checkResponseData(res.data);
// window.SDSPlugin.login({},(res)=>{
// console.log(res);
// var data = uPublic.checkResponseData(res.data);
// if(data){
// cloudsLogin(self, data.UserID);
// }
// },(err)=>{
// console.log(err);
// })
_public.iot.business.sds.login({
data: {
userinfo: {}
},
success: function success(response) {
console.log(response);
if (window.iotDebug) {
iotDebug.push('end: SDSloginSuccees');
}
// console.log(response);
// alert(JSON.stringify(response));
var data = _public.uPublic.checkResponseData(response.data);
if (data) {
self.setShowLoginButtonFlag(false);
if (data.hasOwnProperty('UserID')) {
console.log("sds登陆成功了");
cloudsLogin(self, data.UserID);
}
}, function (err) {
console.log(err);
});
// iot.business.sds.login({
// data: {
//// sds: true
// },
// success: (response) => {
//// console.log(response);
//// if(window.iotDebug){
//// iotDebug.push('end: SDSloginSuccees');
//// }
////// console.log(response);
////// alert(JSON.stringify(response));
//// var data = uPublic.checkResponseData(response.data);
//// if(data){
//// self.setShowLoginButtonFlag(false);
//// if(data.hasOwnProperty('UserID')){
//// console.log("sds登陆成功了");
//// cloudsLogin(self, data.UserID);
//// }
////// iot.navigator.openWindow({
////// url: '../device/index.html',
////// id: 'device'
////// });
//// }else{
////
//// }
// },
// error: (error) => {
//// console.log(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds登陆失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds登陆失败');
//// }
//// //请求失败
////// uPublic.openRequestErrorAlert(self);
// },
// complete: () => {
//// uComponents.hideLoading(self);
// }
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
} else {}
},
error: function error(_error) {
console.log(_error);
if (window.iotDebug) {
iotDebug.push('end: sds登陆失败' + JSON.stringify(_error));
}
if (window.iotDebug) {
iotDebug.upload(_public.iot, 'sds登陆失败');
}
// //请求失败
//// uPublic.openRequestErrorAlert(self);
},
complete: function complete() {
_public.uComponents.hideLoading(self);
}
});
}
function cloudsLogin(self, id) {
......@@ -179,8 +177,8 @@ function cloudsLogin(self, id) {
// }
// });
},
error: function error(_error) {
console.log(_error);
error: function error(_error2) {
console.log(_error2);
// if(window.iotDebug){
// iotDebug.push('end: 云端登陆失败'+JSON.stringify(error));
// }
......
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