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
6ccb82b6
Commit
6ccb82b6
authored
Dec 01, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1201
parent
79571d4b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
60 deletions
+16
-60
dev/src/view/login/v_index.js
+8
-30
web/view/login/index.js
+8
-30
No files found.
dev/src/view/login/v_index.js
View file @
6ccb82b6
...
@@ -22,7 +22,6 @@ function init() {
...
@@ -22,7 +22,6 @@ function init() {
showLoginButtonFlag
:
true
showLoginButtonFlag
:
true
},
},
mounted
(){
mounted
(){
// loginButtonTap(this);
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'start: Debug'
);
iotDebug
.
push
(
'start: Debug'
);
}
}
...
@@ -32,18 +31,13 @@ function init() {
...
@@ -32,18 +31,13 @@ function init() {
if
(
plus
.
os
.
name
==
'Android'
)
{
if
(
plus
.
os
.
name
==
'Android'
)
{
iot
.
permission
.
checkPermission
([
'READ_EXTERNAL_STORAGE'
],
function
(
res
)
{
iot
.
permission
.
checkPermission
([
'READ_EXTERNAL_STORAGE'
],
function
(
res
)
{
console
.
log
(
'success'
,
res
);
console
.
log
(
'success'
,
res
);
// var clientInfo = plus.push.getClientInfo();
// self.setClientId(clientInfo.clientid);
loginButtonTap
(
self
);
loginButtonTap
(
self
);
},
function
(
err
)
{
},
function
(
err
)
{
console
.
log
(
'error'
,
err
);
console
.
log
(
'error'
,
err
);
});
});
}
else
{
}
else
{
console
.
log
(
"start login"
);
loginButtonTap
(
self
);
loginButtonTap
(
self
);
}
}
// loginButtonTap(this);
},
},
methods
:{
methods
:{
getShowLoginButtonFlag
(){
getShowLoginButtonFlag
(){
...
@@ -102,18 +96,16 @@ function loginButtonTap(self){
...
@@ -102,18 +96,16 @@ function loginButtonTap(self){
// },(err)=>{
// },(err)=>{
// console.log(err);
// console.log(err);
// })
// })
alert
(
'login'
);
iot
.
business
.
sds
.
login
({
iot
.
business
.
sds
.
login
({
data
:
{
data
:
{
userinfo
:
{}
userinfo
:
{}
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
alert
(
"response"
);
// alert(JSON.stringify(response)
);
console
.
log
(
response
);
console
.
log
(
response
);
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: SDSloginSuccees'
);
iotDebug
.
push
(
'end: SDSloginSuccees'
);
}
}
// console.log(response);
// alert(JSON.stringify(response));
// alert(JSON.stringify(response));
var
data
=
uPublic
.
checkResponseData
(
response
.
data
);
var
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
if
(
data
){
...
@@ -122,26 +114,19 @@ function loginButtonTap(self){
...
@@ -122,26 +114,19 @@ function loginButtonTap(self){
console
.
log
(
"sds登陆成功了"
);
console
.
log
(
"sds登陆成功了"
);
cloudsLogin
(
self
,
data
.
UserID
);
cloudsLogin
(
self
,
data
.
UserID
);
}
}
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
}
else
{
}
else
{
}
}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
alert
(
"error"
);
// alert(JSON.stringify(error)
);
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: sds登陆失败'
+
JSON
.
stringify
(
error
));
iotDebug
.
push
(
'end: sds登陆失败'
+
JSON
.
stringify
(
error
));
}
}
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'sds登陆失败'
);
iotDebug
.
upload
(
iot
,
'sds登陆失败'
);
}
}
// //请求失败
//// uPublic.openRequestErrorAlert(self);
},
},
complete
:
()
=>
{
complete
:
()
=>
{
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
...
@@ -171,22 +156,15 @@ function cloudsLogin(self, id){
...
@@ -171,22 +156,15 @@ function cloudsLogin(self, id){
id
:
'device'
id
:
'device'
});
});
plus
.
navigator
.
closeSplashscreen
();
plus
.
navigator
.
closeSplashscreen
();
// uPublic.openWindow({
// url: '../device/index.html',
// id: 'device',
// styles: {
// 'background': 'transparent'
// }
// });
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
//
if(window.iotDebug){
if
(
window
.
iotDebug
){
//
iotDebug.push('end: 云端登陆失败'+JSON.stringify(error));
iotDebug
.
push
(
'end: 云端登陆失败'
+
JSON
.
stringify
(
error
));
//
}
}
//
if (window.iotDebug) {
if
(
window
.
iotDebug
)
{
//
iotDebug.upload(iot,'云端登陆失败');
iotDebug
.
upload
(
iot
,
'云端登陆失败'
);
//
}
}
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
},
},
complete
:
()
=>
{
complete
:
()
=>
{
...
...
web/view/login/index.js
View file @
6ccb82b6
...
@@ -29,7 +29,6 @@ function init() {
...
@@ -29,7 +29,6 @@ function init() {
showLoginButtonFlag
:
true
showLoginButtonFlag
:
true
},
},
mounted
:
function
mounted
()
{
mounted
:
function
mounted
()
{
// loginButtonTap(this);
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'start: Debug'
);
iotDebug
.
push
(
'start: Debug'
);
}
}
...
@@ -39,18 +38,13 @@ function init() {
...
@@ -39,18 +38,13 @@ function init() {
if
(
plus
.
os
.
name
==
'Android'
)
{
if
(
plus
.
os
.
name
==
'Android'
)
{
_public
.
iot
.
permission
.
checkPermission
([
'READ_EXTERNAL_STORAGE'
],
function
(
res
)
{
_public
.
iot
.
permission
.
checkPermission
([
'READ_EXTERNAL_STORAGE'
],
function
(
res
)
{
console
.
log
(
'success'
,
res
);
console
.
log
(
'success'
,
res
);
// var clientInfo = plus.push.getClientInfo();
// self.setClientId(clientInfo.clientid);
loginButtonTap
(
self
);
loginButtonTap
(
self
);
},
function
(
err
)
{
},
function
(
err
)
{
console
.
log
(
'error'
,
err
);
console
.
log
(
'error'
,
err
);
});
});
}
else
{
}
else
{
console
.
log
(
"start login"
);
loginButtonTap
(
self
);
loginButtonTap
(
self
);
}
}
// loginButtonTap(this);
},
},
methods
:
{
methods
:
{
...
@@ -110,18 +104,16 @@ function loginButtonTap(self) {
...
@@ -110,18 +104,16 @@ function loginButtonTap(self) {
// },(err)=>{
// },(err)=>{
// console.log(err);
// console.log(err);
// })
// })
alert
(
'login'
);
_public
.
iot
.
business
.
sds
.
login
({
_public
.
iot
.
business
.
sds
.
login
({
data
:
{
data
:
{
userinfo
:
{}
userinfo
:
{}
},
},
success
:
function
success
(
response
)
{
success
:
function
success
(
response
)
{
alert
(
"response"
);
// alert(JSON.stringify(response)
);
console
.
log
(
response
);
console
.
log
(
response
);
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: SDSloginSuccees'
);
iotDebug
.
push
(
'end: SDSloginSuccees'
);
}
}
// console.log(response);
// alert(JSON.stringify(response));
// alert(JSON.stringify(response));
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
)
{
if
(
data
)
{
...
@@ -130,24 +122,17 @@ function loginButtonTap(self) {
...
@@ -130,24 +122,17 @@ function loginButtonTap(self) {
console
.
log
(
"sds登陆成功了"
);
console
.
log
(
"sds登陆成功了"
);
cloudsLogin
(
self
,
data
.
UserID
);
cloudsLogin
(
self
,
data
.
UserID
);
}
}
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
}
else
{}
}
else
{}
},
},
error
:
function
error
(
_error
)
{
error
:
function
error
(
_error
)
{
console
.
log
(
_error
);
console
.
log
(
_error
);
alert
(
"error"
);
// alert(JSON.stringify(error)
);
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: sds登陆失败'
+
JSON
.
stringify
(
_error
));
iotDebug
.
push
(
'end: sds登陆失败'
+
JSON
.
stringify
(
_error
));
}
}
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
,
'sds登陆失败'
);
iotDebug
.
upload
(
_public
.
iot
,
'sds登陆失败'
);
}
}
// //请求失败
//// uPublic.openRequestErrorAlert(self);
},
},
complete
:
function
complete
()
{
complete
:
function
complete
()
{
_public
.
uComponents
.
hideLoading
(
self
);
_public
.
uComponents
.
hideLoading
(
self
);
...
@@ -177,22 +162,15 @@ function cloudsLogin(self, id) {
...
@@ -177,22 +162,15 @@ function cloudsLogin(self, id) {
id
:
'device'
id
:
'device'
});
});
plus
.
navigator
.
closeSplashscreen
();
plus
.
navigator
.
closeSplashscreen
();
// uPublic.openWindow({
// url: '../device/index.html',
// id: 'device',
// styles: {
// 'background': 'transparent'
// }
// });
},
},
error
:
function
error
(
_error2
)
{
error
:
function
error
(
_error2
)
{
console
.
log
(
_error2
);
console
.
log
(
_error2
);
// if(window.iotDebug)
{
if
(
window
.
iotDebug
)
{
// iotDebug.push('end: 云端登陆失败'+JSON.stringify(error
));
iotDebug
.
push
(
'end: 云端登陆失败'
+
JSON
.
stringify
(
_error2
));
//
}
}
//
if (window.iotDebug) {
if
(
window
.
iotDebug
)
{
// iotDebug.upload(iot,
'云端登陆失败');
iotDebug
.
upload
(
_public
.
iot
,
'云端登陆失败'
);
//
}
}
_public
.
uPublic
.
openRequestErrorAlert
(
self
);
_public
.
uPublic
.
openRequestErrorAlert
(
self
);
},
},
complete
:
function
complete
()
{
complete
:
function
complete
()
{
...
...
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