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
5c959d43
authored
2018-12-28 21:42:41 +0800
by
unknown
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
'添加code验证'
1 parent
f27bb7db
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
5 deletions
index.html
js/JSBridge.js
js/controller/mainController.js
js/service/dingdaService.js
js/service/globalService.js
index.html
View file @
5c959d4
...
...
@@ -109,7 +109,7 @@
<!--pnt test ak
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ykvgUlEv77wstKqmFovr56pl4cKRUUEz"></script>-->
<!--pnt prod ak-->
<script
type=
"text/javascript"
src=
"//api.map.baidu.com/api?v=2.0&ak=
QVYxRW2ZxRxLGHycLEcZUTtNfBK8rvwp
"
></script>
<script
type=
"text/javascript"
src=
"//api.map.baidu.com/api?v=2.0&ak=
xa9jEseYXEP96bR5x76vo8FoGo0hnrfI
"
></script>
<script
type=
"text/javascript"
src=
"js/layer/layer.js"
></script>
<script
type=
"text/javascript"
src=
"js/layer/layerMobile/layer.js"
></script>
<script
type=
"text/javascript"
src=
"js/JSBridge.js"
></script>
...
...
js/JSBridge.js
View file @
5c959d4
...
...
@@ -107,7 +107,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
})
callback
(
30.2741500000
,
120.1551500000
,
function
(){})
}
},
3
000
)
},
10
000
)
};
if
(
isAndroid
||
isiOS
)
{
...
...
js/controller/mainController.js
View file @
5c959d4
...
...
@@ -15,9 +15,8 @@ angular.module('myApp')
if
(
!
$scope
.
userinfo
)
{
var
code
=
getUrl
(
'code'
)
if
(
code
){
dingdaService
.
verifyThird
Code
(
code
).
success
(
function
(
res
)
{
dingdaService
.
loginBy
Code
(
code
).
success
(
function
(
res
)
{
if
(
res
.
mate
.
code
==
200
)
{
dingdaService
.
verifyPhoneCode
(
res
.
data
.
mobile
,
res
.
data
.
code
).
success
(
function
(
data
)
{
if
(
data
.
meta
.
code
==
200
)
{
data
.
data
.
userName
=
$scope
.
phoneNumberVal
;
globalService
.
saveData
(
'user'
,
data
.
data
);
...
...
@@ -37,7 +36,9 @@ angular.module('myApp')
// layer.msg(data.data.error);
return
;
}
})
// dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
//
// })
}
if
(
res
.
mate
.
code
==
500
){
$state
.
go
(
'login'
,
{},
{
reload
:
true
});
...
...
js/service/dingdaService.js
View file @
5c959d4
...
...
@@ -10,6 +10,15 @@ angular.module('myApp.services')
});
return
res
;
},
loginByCode
:
function
(
code
)
{
var
url
=
globalService
.
getParam
(
'dingaCodeAPI'
)
+
'/open-api/user/get/bycode/'
+
code
;
var
res
=
$http
.
post
(
url
,
{}).
success
(
function
(
data
,
status
)
{
}).
error
(
function
(
data
,
status
)
{
alert
(
data
.
meta
.
message
)
});
return
res
;
},
verifyPhoneCode
:
function
(
phone
,
code
){
var
url
=
globalService
.
getParam
(
'dingdaLoginAPI'
)
+
'/login/sms?mobile='
+
phone
+
'&code='
+
code
;
var
res
=
$http
.
post
(
url
,
{}).
success
(
function
(
data
,
status
)
{
...
...
js/service/globalService.js
View file @
5c959d4
...
...
@@ -44,6 +44,8 @@ angular.module('myApp.services')
// 测试环境
// var dingdaLoginAPI = "https://auth.api.dingdachuxing.com";
globalConfig
.
setParam
(
"dingdaLoginAPI"
,
dingdaLoginAPI
);
var
dingaCodeAPI
=
"http://112.13.95.178:7080"
globalConfig
.
setParam
(
"dingaCodeAPI"
,
dingaCodeAPI
);
$rootScope
.
$watch
(
"data.user"
,
function
(
newVal
,
oldVal
){
if
(
!
newVal
){
...
...
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