diff --git a/app/api/mobile/apis/new_comment.rb b/app/api/mobile/apis/new_comment.rb index 3c57636b5..f3c337cd1 100644 --- a/app/api/mobile/apis/new_comment.rb +++ b/app/api/mobile/apis/new_comment.rb @@ -75,15 +75,9 @@ module Mobile authenticate! - subscribe = 0 #默认未关注 - - #-------------------获取用户是否关注此公众号----------------------------- - openid = session[:wechat_openid] - raise "无法获取到openid,请在微信中打开本页面" unless openid - user_info = Wechat.api.user(openid) - Rails.logger.info "user_info!!!!!!!!!" - Rails.logger.info user_info - subscribe = user_info["subscribe"] + ## 能进来的就是已关注 + ## 因为取消订阅的记录被删除了 + subscribe = 1 #默认未关注 status = 0 tip = 0 #0班级1项目 diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 25ce1f83e..0a5d23017 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -515,8 +515,8 @@ class WechatsController < ActionController::Base private def get_openid_from_code(code) - if code =='only-for-test' - openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY' + if code =='test' + openid = 'orgVLv8TlS6e7FDiI6xdTGHRaaRo' session[:wechat_openid] = openid return openid end