微信的@回复功能,不稳定 issue[11025]

This commit is contained in:
guange 2016-12-31 19:26:41 +08:00
parent 474b516653
commit 498ad554ba
2 changed files with 5 additions and 11 deletions

View File

@ -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项目

View File

@ -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