From b86669d49c3de59d1640aab617814b12e89a253c Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Apr 2016 14:57:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=A8=A1=E6=9D=BF=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1234567 | 2 +- public/javascripts/wechat/app.js | 50 +++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/1234567 b/1234567 index f21c6a454..096f1af7a 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"GrEg56Sg5QRM7IXghWlaDzNd-7iaQsqX2acszXkSTFwOh_OxtN_UNIJsj9rlSZeSkZSofQwd0KvFGv_StzARHeLw81JllcI3a3VuXgZ_cjbQnM3m00g0HiLtTniQFsEIUVIdABAPQD","expires_in":7200,"got_token_at":1461314104} +{"access_token":"Tzi0x9dIp8qqn2CQ7kLnqIjyJvGweEImLmBcbCnev8VTHGAbXbNnihigWDkjJXuthZlGBkIpru5tSoGBSYz8EPktPmdL3CaH1SQXRLxK0FJwHg85fhxMnro_5YmrKO_jDPCaAIAHTG","expires_in":7200,"got_token_at":1461566075} \ No newline at end of file diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 0a6b97e5b..e5444c384 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -190,7 +190,13 @@ app.controller('IssueController', function($scope, $http, $routeParams, auth, co }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addIssueReply = function(data){ console.log(data.comment); @@ -221,7 +227,13 @@ app.controller('HomeworkController', function($scope, $http, $routeParams, auth, }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addHomeworkReply = function(data){ console.log(data.comment); @@ -251,7 +263,13 @@ app.controller('CourseNoticeController', function($scope, $http, $routeParams, a }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addNoticeReply = function(data){ console.log(data.comment); @@ -281,7 +299,13 @@ app.controller('DiscussionController', function($scope, $http, $routeParams, aut }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addDiscussionReply = function(data){ console.log(data.comment); @@ -311,7 +335,13 @@ app.controller('JournalsController', function($scope, $http, $routeParams, auth, }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addJournalReply = function(data){ console.log(data.comment); @@ -343,7 +373,13 @@ app.controller('BlogController', function($scope, $http, $routeParams, auth, com }); }; - loadData($routeParams.id); + auth.getOpenId().then( + function successCallback(response){ + loadData($routeParams.id); + }, function errorCallback(response) { + alert("获取openid出错:"+response); + } + ); $scope.addBlogReply = function(data){ console.log(data.comment); @@ -436,7 +472,7 @@ app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProv .otherwise({ redirectTo: '/activities' }); - $httpProvider.interceptors.push('timestampMarker'); + //$httpProvider.interceptors.push('timestampMarker'); }]); //loading