This commit is contained in:
guange 2016-06-17 18:48:27 +08:00
parent b9280caf36
commit 9d19caa736
3 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,7 @@ class WechatsController < ActionController::Base
raise "无法获取到微信openid" unless openid raise "无法获取到微信openid" unless openid
render :json => {status:0, openid: openid} render :json => {status:0, openid: openid}
rescue Exception=>e rescue Exception=>e
render :json => {status: -1, msg: e.message} render :json => {status: -1, message: e.message}
end end
end end

View File

@ -32,11 +32,11 @@ app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams
function(response) { function(response) {
vm.loginFailed = (response.data.status != 0); vm.loginFailed = (response.data.status != 0);
console.log(response.data); console.log(response.data);
vm.alertService.showMessage('出错了', response.data.msg); vm.alertService.showMessage('出错了', response.data.message);
if (!$scope.loginFailed) { //绑定成功 if (!$scope.loginFailed) { //绑定成功
} else { } else {
vm.alertService.showMessage('出错了', response.data.msg); vm.alertService.showMessage('出错了', response.data.message);
} }
} }
).catch(function(e){ ).catch(function(e){

View File

@ -49,7 +49,7 @@ app.factory('auth', ['$http','$routeParams', '$q', 'session', function($http,$ro
method: 'POST' method: 'POST'
}).then(function successCallback(response) { }).then(function successCallback(response) {
if(response.data.status != 0){ if(response.data.status != 0){
deferred.reject(response.data.msg); deferred.reject(response.data.message);
} else{ } else{
_openid = response.data.openid; _openid = response.data.openid;
session.save("openid", _openid); session.save("openid", _openid);