微信的@回复功能,不稳定 issue[11025]
This commit is contained in:
parent
474b516653
commit
498ad554ba
|
@ -75,15 +75,9 @@ module Mobile
|
||||||
|
|
||||||
authenticate!
|
authenticate!
|
||||||
|
|
||||||
subscribe = 0 #默认未关注
|
## 能进来的就是已关注
|
||||||
|
## 因为取消订阅的记录被删除了
|
||||||
#-------------------获取用户是否关注此公众号-----------------------------
|
subscribe = 1 #默认未关注
|
||||||
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"]
|
|
||||||
|
|
||||||
status = 0
|
status = 0
|
||||||
tip = 0 #0班级1项目
|
tip = 0 #0班级1项目
|
||||||
|
|
|
@ -515,8 +515,8 @@ class WechatsController < ActionController::Base
|
||||||
|
|
||||||
private
|
private
|
||||||
def get_openid_from_code(code)
|
def get_openid_from_code(code)
|
||||||
if code =='only-for-test'
|
if code =='test'
|
||||||
openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY'
|
openid = 'orgVLv8TlS6e7FDiI6xdTGHRaaRo'
|
||||||
session[:wechat_openid] = openid
|
session[:wechat_openid] = openid
|
||||||
return openid
|
return openid
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue