第三方登录接口

$rootScope.getTokenOther = function(formdata) {
// console.log("getTokenOther formdata", formdata);
MyServer.otherlogin(formdata, function(data) {
console.log("otherlogin data", data);
if (data.code == 'SUCCESS') {
$rootScope.curUser = data.data;
$rootScope.loginSuccess();
} else if (data.code == 'REG') {
// 还没有绑定账号,需要跳转到绑定账号界面
console.log('还没有绑定账号,需要跳转到绑定账号界面');
$.cookie('otherLoginInfo', JSON.stringify(formdata));
$rootScope.otherLoginInfo = formdata;
// $state.go('index.accountBind');
$rootScope.showaccountBind();
} else {
$rootScope.msg = MyServer.getLan('otherlogin', data.code);
console.log('otherlogin error', $rootScope.msg);
}
}, function(error) {
console.log("otherlogin error", error);
});
};

posted @ 2017-09-19 20:48  abcByme  阅读(806)  评论(0编辑  收藏  举报