From abf4a809428cf907ad48b558dc8eb58a13e2d4ed Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 8 Apr 2016 14:42:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E5=88=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/middleware/error_handler.rb | 3 ++- public/javascripts/wechat/app.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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) { });