Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoorLock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
felix
DoorLock
Commits
e26abb1d
Commit
e26abb1d
authored
Nov 24, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1124
parent
22735af2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
96 deletions
+94
-96
dev/src/view/login/v_index.js
+47
-47
web/view/login/index.js
+47
-49
No files found.
dev/src/view/login/v_index.js
View file @
e26abb1d
...
@@ -85,60 +85,60 @@ function initComponentsConfig() {
...
@@ -85,60 +85,60 @@ function initComponentsConfig() {
}
}
function
loginButtonTap
(
self
){
function
loginButtonTap
(
self
){
//
uComponents.showLoading(self);
uComponents
.
showLoading
(
self
);
// if(window.iotDebug){
// if(window.iotDebug){
// iotDebug.push('start: initSDSLogin');
// iotDebug.push('start: initSDSLogin');
// }
// }
window
.
SDSPlugin
.
login
({},(
res
)
=>
{
// window.SDSPlugin.login({},(res)=>{
console
.
log
(
res
);
// console.log(res);
var
data
=
uPublic
.
checkResponseData
(
res
.
data
);
// 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
){
if
(
data
){
self
.
setShowLoginButtonFlag
(
false
);
if
(
data
.
hasOwnProperty
(
'UserID'
)){
console
.
log
(
"sds登陆成功了"
);
cloudsLogin
(
self
,
data
.
UserID
);
cloudsLogin
(
self
,
data
.
UserID
);
}
}
},(
err
)
=>
{
// iot.navigator.openWindow({
console
.
log
(
err
);
// url: '../device/index.html',
})
// id: 'device'
// 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);
// }
// });
// });
}
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
){
function
cloudsLogin
(
self
,
id
){
...
...
web/view/login/index.js
View file @
e26abb1d
...
@@ -93,60 +93,58 @@ function initComponentsConfig() {
...
@@ -93,60 +93,58 @@ function initComponentsConfig() {
}
}
function
loginButtonTap
(
self
)
{
function
loginButtonTap
(
self
)
{
//
uComponents.showLoading(self);
_public
.
uComponents
.
showLoading
(
self
);
// if(window.iotDebug){
// if(window.iotDebug){
// iotDebug.push('start: initSDSLogin');
// iotDebug.push('start: initSDSLogin');
// }
// }
window
.
SDSPlugin
.
login
({},
function
(
res
)
{
// window.SDSPlugin.login({},(res)=>{
console
.
log
(
res
);
// console.log(res);
var
data
=
_public
.
uPublic
.
checkResponseData
(
res
.
data
);
// 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
)
{
if
(
data
)
{
self
.
setShowLoginButtonFlag
(
false
);
if
(
data
.
hasOwnProperty
(
'UserID'
))
{
console
.
log
(
"sds登陆成功了"
);
cloudsLogin
(
self
,
data
.
UserID
);
cloudsLogin
(
self
,
data
.
UserID
);
}
}
},
function
(
err
)
{
// iot.navigator.openWindow({
console
.
log
(
err
);
// url: '../device/index.html',
});
// id: 'device'
// 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);
// }
// });
// });
}
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
)
{
function
cloudsLogin
(
self
,
id
)
{
...
@@ -179,8 +177,8 @@ function cloudsLogin(self, id) {
...
@@ -179,8 +177,8 @@ function cloudsLogin(self, id) {
// }
// }
// });
// });
},
},
error
:
function
error
(
_error
)
{
error
:
function
error
(
_error
2
)
{
console
.
log
(
_error
);
console
.
log
(
_error
2
);
// if(window.iotDebug){
// if(window.iotDebug){
// iotDebug.push('end: 云端登陆失败'+JSON.stringify(error));
// iotDebug.push('end: 云端登陆失败'+JSON.stringify(error));
// }
// }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment