|
@@ -5,9 +5,10 @@
|
|
$scope.loginbywx = function(){
|
|
$scope.loginbywx = function(){
|
|
var scope = "snsapi_userinfo", state = "_" + (+new Date());
|
|
var scope = "snsapi_userinfo", state = "_" + (+new Date());
|
|
Wechat.auth(scope, state, function (response) {
|
|
Wechat.auth(scope, state, function (response) {
|
|
- alert("response:"+JSON.stringify(response));
|
|
|
|
|
|
+ // alert("response:"+JSON.stringify(response));
|
|
// response.code;
|
|
// response.code;
|
|
if(response.code){
|
|
if(response.code){
|
|
|
|
+ msg.loading('登录中...');
|
|
userService.loginbywx(response.code).then(function(result){
|
|
userService.loginbywx(response.code).then(function(result){
|
|
alert("loginbywx success: " + JSON.stringify(result));
|
|
alert("loginbywx success: " + JSON.stringify(result));
|
|
msg.hide();
|
|
msg.hide();
|
|
@@ -17,8 +18,8 @@
|
|
$scope.user=storage.getObject('user');
|
|
$scope.user=storage.getObject('user');
|
|
$state.go('app.home');
|
|
$state.go('app.home');
|
|
},function(error){
|
|
},function(error){
|
|
- alert("loginbywx Failed: " + JSON.stringify(error));
|
|
|
|
- $state.go("loginAccount",{wechat:$scope.wecaht})
|
|
|
|
|
|
+ // alert("loginbywx Failed: " + JSON.stringify(error));
|
|
|
|
+ $state.go("loginAccount",{wechat:response.code})
|
|
//window.location.href="#/account/loginAccount?wechat=$scope.wecaht";
|
|
//window.location.href="#/account/loginAccount?wechat=$scope.wecaht";
|
|
});
|
|
});
|
|
}
|
|
}
|