5c959d43 by unknown

'添加code验证'

1 parent f27bb7db
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
109 <!--pnt test ak 109 <!--pnt test ak
110 <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ykvgUlEv77wstKqmFovr56pl4cKRUUEz"></script>--> 110 <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ykvgUlEv77wstKqmFovr56pl4cKRUUEz"></script>-->
111 <!--pnt prod ak--> 111 <!--pnt prod ak-->
112 <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=QVYxRW2ZxRxLGHycLEcZUTtNfBK8rvwp"></script> 112 <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=xa9jEseYXEP96bR5x76vo8FoGo0hnrfI"></script>
113 <script type="text/javascript" src="js/layer/layer.js"></script> 113 <script type="text/javascript" src="js/layer/layer.js"></script>
114 <script type="text/javascript" src="js/layer/layerMobile/layer.js"></script> 114 <script type="text/javascript" src="js/layer/layerMobile/layer.js"></script>
115 <script type="text/javascript" src="js/JSBridge.js"></script> 115 <script type="text/javascript" src="js/JSBridge.js"></script>
......
...@@ -107,7 +107,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { ...@@ -107,7 +107,7 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
107 }) 107 })
108 callback(30.2741500000, 120.1551500000, function(){}) 108 callback(30.2741500000, 120.1551500000, function(){})
109 } 109 }
110 }, 3000) 110 }, 10000)
111 }; 111 };
112 112
113 if(isAndroid || isiOS) { 113 if(isAndroid || isiOS) {
......
...@@ -15,9 +15,8 @@ angular.module('myApp') ...@@ -15,9 +15,8 @@ angular.module('myApp')
15 if(!$scope.userinfo) { 15 if(!$scope.userinfo) {
16 var code = getUrl('code') 16 var code = getUrl('code')
17 if(code){ 17 if(code){
18 dingdaService.verifyThirdCode(code).success(function (res) { 18 dingdaService.loginByCode(code).success(function (res) {
19 if(res.mate.code == 200) { 19 if(res.mate.code == 200) {
20 dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
21 if (data.meta.code == 200) { 20 if (data.meta.code == 200) {
22 data.data.userName = $scope.phoneNumberVal; 21 data.data.userName = $scope.phoneNumberVal;
23 globalService.saveData('user',data.data); 22 globalService.saveData('user',data.data);
...@@ -37,7 +36,9 @@ angular.module('myApp') ...@@ -37,7 +36,9 @@ angular.module('myApp')
37 // layer.msg(data.data.error); 36 // layer.msg(data.data.error);
38 return; 37 return;
39 } 38 }
40 }) 39 // dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
40 //
41 // })
41 } 42 }
42 if(res.mate.code == 500){ 43 if(res.mate.code == 500){
43 $state.go('login', {}, {reload: true}); 44 $state.go('login', {}, {reload: true});
......
...@@ -10,6 +10,15 @@ angular.module('myApp.services') ...@@ -10,6 +10,15 @@ angular.module('myApp.services')
10 }); 10 });
11 return res; 11 return res;
12 }, 12 },
13 loginByCode:function (code) {
14 var url = globalService.getParam('dingaCodeAPI') + '/open-api/user/get/bycode/' + code;
15 var res = $http.post(url, {}).success(function(data, status) {
16
17 }).error(function(data, status) {
18 alert(data.meta.message)
19 });
20 return res;
21 },
13 verifyPhoneCode : function(phone , code){ 22 verifyPhoneCode : function(phone , code){
14 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + '&code=' + code; 23 var url = globalService.getParam('dingdaLoginAPI') + '/login/sms?mobile=' + phone + '&code=' + code;
15 var res = $http.post(url, {}).success(function(data, status) { 24 var res = $http.post(url, {}).success(function(data, status) {
......
...@@ -44,6 +44,8 @@ angular.module('myApp.services') ...@@ -44,6 +44,8 @@ angular.module('myApp.services')
44 // 测试环境 44 // 测试环境
45 // var dingdaLoginAPI = "https://auth.api.dingdachuxing.com"; 45 // var dingdaLoginAPI = "https://auth.api.dingdachuxing.com";
46 globalConfig.setParam("dingdaLoginAPI", dingdaLoginAPI); 46 globalConfig.setParam("dingdaLoginAPI", dingdaLoginAPI);
47 var dingaCodeAPI = "http://112.13.95.178:7080"
48 globalConfig.setParam("dingaCodeAPI", dingaCodeAPI);
47 49
48 $rootScope.$watch("data.user",function(newVal, oldVal){ 50 $rootScope.$watch("data.user",function(newVal, oldVal){
49 if(!newVal){ 51 if(!newVal){
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!