fdb4f2b8 by fuenxin

update getUrl

1 parent 83954b2c
...@@ -4,6 +4,14 @@ angular.module('myApp') ...@@ -4,6 +4,14 @@ angular.module('myApp')
4 $rootScope.isRendBike = false; 4 $rootScope.isRendBike = false;
5 $rootScope.isLoadFinish = false; 5 $rootScope.isLoadFinish = false;
6 $scope.unfinishOrder = {}; 6 $scope.unfinishOrder = {};
7
8 var init = function() {
9 // globalService.init();
10 function getUrl(name){
11 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
12 var r = window.location.search.substr(1).match(reg);
13 if(r!=null)return unescape(r[2]); return null;
14 }
7 var code = getUrl('code') 15 var code = getUrl('code')
8 var loginCode = function (code) { 16 var loginCode = function (code) {
9 if(code){ 17 if(code){
...@@ -27,8 +35,8 @@ angular.module('myApp') ...@@ -27,8 +35,8 @@ angular.module('myApp')
27 content: data.meta.message, 35 content: data.meta.message,
28 time:1 36 time:1
29 }); 37 });
30 // alert(data.meta.message); 38 // alert(data.meta.message);
31 // layer.msg(data.data.error); 39 // layer.msg(data.data.error);
32 return; 40 return;
33 } 41 }
34 }) 42 })
...@@ -42,13 +50,6 @@ angular.module('myApp') ...@@ -42,13 +50,6 @@ angular.module('myApp')
42 $scope.userinfo.loginState = false; 50 $scope.userinfo.loginState = false;
43 } 51 }
44 } 52 }
45 var init = function() {
46 // globalService.init();
47 function getUrl(name){
48 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
49 var r = window.location.search.substr(1).match(reg);
50 if(r!=null)return unescape(r[2]); return null;
51 }
52 $scope.userinfo = globalService.getData("user"); 53 $scope.userinfo = globalService.getData("user");
53 if(!$scope.userinfo ) { 54 if(!$scope.userinfo ) {
54 loginCode() 55 loginCode()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!