9376cbad by ex

获取code 重新登录

1 parent 9e43930c
...@@ -17,28 +17,27 @@ angular.module('myApp') ...@@ -17,28 +17,27 @@ angular.module('myApp')
17 if(code){ 17 if(code){
18 dingdaService.verifyThirdCode(code).success(function (res) { 18 dingdaService.verifyThirdCode(code).success(function (res) {
19 if(res.mate.code == 200) { 19 if(res.mate.code == 200) {
20 if (data.meta.code == 200) { 20 dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) {
21 data.data.userName = $scope.phoneNumberVal; 21 if (data.meta.code == 200) {
22 globalService.saveData('user',data.data); 22 data.data.userName = $scope.phoneNumberVal;
23 // layer.open({ 23 globalService.saveData('user',data.data);
24 // content: '登录成功', 24 // layer.open({
25 // time:1 25 // content: '登录成功',
26 // }); 26 // time:1
27 setTimeout(function() { 27 // });
28 location.reload(); 28 setTimeout(function() {
29 } , 300); 29 location.reload();
30 } else if (data.meta.code == 401) { 30 } , 300);
31 layer.open({ 31 } else if (data.meta.code == 401) {
32 content: data.meta.message, 32 layer.open({
33 time:1 33 content: data.meta.message,
34 }); 34 time:1
35 });
35 // alert(data.meta.message); 36 // alert(data.meta.message);
36 // layer.msg(data.data.error); 37 // layer.msg(data.data.error);
37 return; 38 return;
38 } 39 }
39 // dingdaService.verifyPhoneCode(res.data.mobile, res.data.code).success(function (data) { 40 })
40 //
41 // })
42 } 41 }
43 if(res.mate.code == 500){ 42 if(res.mate.code == 500){
44 $state.go('login', {}, {reload: true}); 43 $state.go('login', {}, {reload: true});
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!