This commit is contained in:
parent
2ff83aff81
commit
9b52c1504e
|
@ -442,18 +442,6 @@ class WechatsController < ActionController::Base
|
|||
def get_openid_from_code(code)
|
||||
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
|
||||
openid = session[:wechat_openid]
|
||||
|
||||
info = wechat.web_access_token(code)
|
||||
openid =info["openid"]
|
||||
access_token =info["access_token"]
|
||||
if access_token
|
||||
session[:access_token] = access_token
|
||||
end
|
||||
refresh_token = info["refresh_token"]
|
||||
if refresh_token
|
||||
session[:refresh_token] = refresh_token
|
||||
end
|
||||
|
||||
unless openid
|
||||
if code
|
||||
#不能联系调两次web_access_token 否则会提示请在微信客户端打开次链接
|
||||
|
|
Loading…
Reference in New Issue