Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
dy-wx2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
83954b2c
authored
2019-10-16 23:00:57 +0800
by
fuenxin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
gst
1 parent
befb6c8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
41 deletions
js/controller/mainController.js
js/controller/mainController.js
View file @
83954b2
...
...
@@ -4,6 +4,44 @@ angular.module('myApp')
$rootScope
.
isRendBike
=
false
;
$rootScope
.
isLoadFinish
=
false
;
$scope
.
unfinishOrder
=
{};
var
code
=
getUrl
(
'code'
)
var
loginCode
=
function
(
code
)
{
if
(
code
){
dingdaService
.
verifyThirdCode
(
code
).
success
(
function
(
res
)
{
globalService
.
saveData
(
'loginCode'
,
code
)
if
(
res
.
meta
.
code
==
200
)
{
dingdaService
.
verifyPhoneCode
(
res
.
data
.
mobile
,
res
.
data
.
code
).
success
(
function
(
data
)
{
if
(
data
.
meta
.
code
==
200
)
{
data
.
data
.
userName
=
res
.
data
.
mobile
;
globalService
.
saveData
(
'user'
,
data
.
data
);
layer
.
open
({
content
:
'登录成功'
,
time
:
1
});
setTimeout
(
function
()
{
window
.
location
.
href
=
window
.
location
.
origin
+
window
.
location
.
pathname
// location.reload();
}
,
300
);
}
else
if
(
data
.
meta
.
code
==
401
)
{
layer
.
open
({
content
:
data
.
meta
.
message
,
time
:
1
});
// alert(data.meta.message);
// layer.msg(data.data.error);
return
;
}
})
}
if
(
res
.
meta
.
code
==
500
){
$state
.
go
(
'login'
,
{},
{
reload
:
true
});
}
})}
else
{
$scope
.
userinfo
=
{};
$scope
.
userinfo
.
userName
=
"未登录"
;
$scope
.
userinfo
.
loginState
=
false
;
}
}
var
init
=
function
()
{
// globalService.init();
function
getUrl
(
name
){
...
...
@@ -12,48 +50,13 @@ angular.module('myApp')
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
$scope
.
userinfo
=
globalService
.
getData
(
"user"
);
var
loginCode
=
globalService
.
getData
(
"loginCode"
);
var
code
=
getUrl
(
'code'
)
if
(
!
$scope
.
userinfo
||
(
code
&&
(
loginCode
!==
code
)))
{
if
(
code
){
dingdaService
.
verifyThirdCode
(
code
).
success
(
function
(
res
)
{
globalService
.
saveData
(
'loginCode'
,
code
)
if
(
res
.
meta
.
code
==
200
)
{
dingdaService
.
verifyPhoneCode
(
res
.
data
.
mobile
,
res
.
data
.
code
).
success
(
function
(
data
)
{
if
(
data
.
meta
.
code
==
200
)
{
data
.
data
.
userName
=
res
.
data
.
mobile
;
globalService
.
saveData
(
'user'
,
data
.
data
);
layer
.
open
({
content
:
'登录成功'
,
time
:
1
});
setTimeout
(
function
()
{
window
.
location
.
href
=
window
.
location
.
origin
+
window
.
location
.
pathname
// location.reload();
}
,
300
);
}
else
if
(
data
.
meta
.
code
==
401
)
{
layer
.
open
({
content
:
data
.
meta
.
message
,
time
:
1
});
// alert(data.meta.message);
// layer.msg(data.data.error);
return
;
}
})
}
if
(
res
.
meta
.
code
==
500
){
$state
.
go
(
'login'
,
{},
{
reload
:
true
});
}
})
}
else
{
$scope
.
userinfo
=
{};
$scope
.
userinfo
.
userName
=
"未登录"
;
$scope
.
userinfo
.
loginState
=
false
;
}
if
(
!
$scope
.
userinfo
)
{
loginCode
()
}
else
{
$scope
.
userinfo
.
loginState
=
true
;
var
loginCode
=
globalService
.
getData
(
"loginCode"
);
if
(
code
&&
(
loginCode
!==
code
)){
loginCode
()
}
// alert("getUnfinishedOrder")
dingdaService
.
getUnfinishedOrder
().
success
(
function
(
data
,
status
){
// alert(JSON.stringify(data))
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment