This commit is contained in:
parent
3b42861a54
commit
fd036d758e
|
@ -442,14 +442,16 @@ class WechatsController < ActionController::Base
|
|||
def get_openid_from_code(code)
|
||||
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
|
||||
openid = session[:wechat_openid]
|
||||
|
||||
unless openid
|
||||
if code
|
||||
openid = wechat.web_access_token(code)["openid"]
|
||||
access_token = wechat.web_access_token(code)["access_token"]
|
||||
if access_token
|
||||
session[:access_token] = access_token
|
||||
end
|
||||
info = wechat.web_access_token(code)
|
||||
logger.info "web_access_token!!!!!!!!!!!!"
|
||||
logger.info info
|
||||
# access_token = wechat.web_access_token(code)["access_token"]
|
||||
# if access_token
|
||||
# session[:access_token] = access_token
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue