错误信息打印到日志

This commit is contained in:
guange 2016-04-08 14:42:23 +08:00
parent 5241dddca2
commit abf4a80942
2 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,8 @@ module Mobile
@app.call(@env)
rescue =>e
message = {status: 1, message: e.message }.to_json
Rails.logger.error e
Rails.logger.error e.inspect
Rails.logger.error e.backtrace
status = 200
headers = { 'Content-Type' => content_type }
Rack::Response.new([message], status, headers).finish

View File

@ -1,13 +1,13 @@
var app = angular.module('wechat', ['ngRoute','ngCookies']);
var apiUrl = 'http://wechat.trustie.net/api/v1/';
var debug = true; //调试标志,如果在本地请置为true
var debug = false; //调试标志,如果在本地请置为true
if(debug===true){
apiUrl = 'http://localhost:3000/api/v1/';
}
app.factory('auth', function($http,$routeParams, $cookies, $q){
var _openid = '';
var _openid = 'oCnvgv1erQGHzv5GlNZ3sxa2hnSo';
if(debug===true){
_openid = "1";
@ -68,7 +68,7 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
console.log("ActivityController load");
$scope.activities = rms.get("activities") || [];
$scope.page = 0;
$scope.page = 1;
var loadActData = function(page){
$scope.page = page;
@ -80,6 +80,7 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
$scope.activities = $scope.activities.concat(response.data.data);
$scope.all_count = response.data.all_count;
$scope.count = response.data.count;
console.log(response.data);
rms.save('activities', $scope.activities);
}, function errorCallback(response) {
});