diff --git a/app/api/mobile/middleware/error_handler.rb b/app/api/mobile/middleware/error_handler.rb index 567c4519b..e827cb4d8 100644 --- a/app/api/mobile/middleware/error_handler.rb +++ b/app/api/mobile/middleware/error_handler.rb @@ -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 diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index ce90cd686..5f8db3ec9 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -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) { });