83954b2c by fuenxin

gst

1 parent befb6c8e
......@@ -4,17 +4,8 @@ angular.module('myApp')
$rootScope.isRendBike = false;
$rootScope.isLoadFinish = false;
$scope.unfinishOrder = {};
var init = function() {
// globalService.init();
function getUrl(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
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))) {
var loginCode = function (code) {
if(code){
dingdaService.verifyThirdCode(code).success(function (res) {
globalService.saveData('loginCode', code)
......@@ -45,15 +36,27 @@ angular.module('myApp')
if(res.meta.code == 500){
$state.go('login', {}, {reload: true});
}
})
} else {
})} else {
$scope.userinfo = {};
$scope.userinfo.userName = "未登录";
$scope.userinfo.loginState = false;
}
}
var init = function() {
// globalService.init();
function getUrl(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
$scope.userinfo = globalService.getData("user");
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))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!