测试测试
This commit is contained in:
parent
ba0d32bd09
commit
962a62577b
|
@ -23,7 +23,21 @@ module Mobile
|
|||
refresh_token = session[:refresh_token]
|
||||
|
||||
if access_token.present? && refresh_token.present?
|
||||
begin
|
||||
refreshinfo = Wechat.api.web_refresh_access_token(refresh_token)
|
||||
rescue
|
||||
info = wechat.web_access_token(session[:wechat_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
|
||||
refreshinfo = Wechat.api.web_refresh_access_token(refresh_token)
|
||||
end
|
||||
|
||||
access_token = refreshinfo["access_token"]
|
||||
refresh_token = refreshinfo["refresh_token"]
|
||||
|
|
Loading…
Reference in New Issue