diff --git a/1234567 b/1234567 index 1aa01764f..dfd7e3ee3 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"G4QG7VJgF8Vmm71kLgC1XgHvyeXK-ZZrikaG7sPBrKuw6vgbYzV2FPYuNq3wNp7e-hsyfDI--rTlVspQXZk5bRK_CsZl8wWvuiPazV9mznGpOBGE5zVR8WOtvlqhylpHIMBdABABFU","expires_in":7200,"got_token_at":1460179500} \ No newline at end of file +{"access_token":"7MBMEBoE6sSC15bIHZYAZSxj47yCKlbWEVjrkUgEJxPP3K083tbhc1RIWmxGu3WoB5dAXxK_yd4l1jrcvt6YrsTcOfFGRirOHVfzrpvhsQgxOoxcdc7YljfO_dnwUtWgFTAcAIALZG","expires_in":7200,"got_token_at":1460189856} \ No newline at end of file diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index 86b69e993..cfe6fe3f3 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -110,7 +110,11 @@ class BlogComment < ActiveRecord::Base } } logger.info "start send template message: #{data}" - req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + logger.error "[blog_comment] ===> #{e}" + end logger.info "send over. #{req}" end end diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 0c58458a6..ab687c869 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -135,7 +135,11 @@ class HomeworkCommon < ActiveRecord::Base } } logger.info "start send template message: #{data}" - req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + logger.error "[homework_common] ===> #{e}" + end logger.info "send over. #{req}" end end diff --git a/app/models/journal.rb b/app/models/journal.rb index eede42d98..499abf344 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -271,7 +271,11 @@ class Journal < ActiveRecord::Base } } logger.info "start send template message: #{data}" - req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + logger.error "[journal] ===> #{e}" + end logger.info "send over. #{req}" end end diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 22bc33cd1..f85fb7000 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -341,7 +341,11 @@ class JournalsForMessage < ActiveRecord::Base } } logger.info "start send template message: #{data}" - req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + logger.error "[journal_for_message] ===> #{e}" + end logger.info "send over. #{req}" end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 5bfbfec01..4b7180857 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -1155,9 +1155,12 @@ class Mailer < ActionMailer::Base } logger.info "start send template message: #{data}" - req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + begin + req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data) + rescue Exception => e + logger.error "[mailer] ===> #{e}" + end logger.info "send over. #{req}" - end end end diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 25cb0f169..4c71334cc 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -10,7 +10,7 @@ app.factory('auth', function($http,$routeParams, $cookies, $q){ var _openid = ''; if(debug===true){ - _openid = "6"; + _openid = "3"; } var getOpenId = function() {