Commit 2f9295f7 by lanrion

updated oauth api

parent 712de9f5
...@@ -25,12 +25,12 @@ module WeixinAuthorize ...@@ -25,12 +25,12 @@ module WeixinAuthorize
# refresh_token: 填写通过access_token获取到的refresh_token参数 # refresh_token: 填写通过access_token获取到的refresh_token参数
def refresh_oauth2_token(refresh_token) def refresh_oauth2_token(refresh_token)
WeixinAuthorize.http_get_without_token("/sns/oauth2/refresh_token?appid=#{app_id}&grant_type=refresh_token&refresh_token=#{refresh_token}") WeixinAuthorize.http_get_without_token("/sns/oauth2/refresh_token?appid=#{app_id}&grant_type=refresh_token&refresh_token=#{refresh_token}", {}, "api")
end end
# 如果网页授权作用域为snsapi_userinfo,则此时开发者可以通过access_token和openid拉取用户信息了。 # 如果网页授权作用域为snsapi_userinfo,则此时开发者可以通过access_token和openid拉取用户信息了。
def get_oauth_userinfo(openid, oauth_token, lang="zh_CN") def get_oauth_userinfo(openid, oauth_token, lang="zh_CN")
WeixinAuthorize.http_get_without_token("/sns/userinfo?access_token=#{oauth_token}&openid=#{openid}&lang=#{lang}") WeixinAuthorize.http_get_without_token("/sns/userinfo?access_token=#{oauth_token}&openid=#{openid}&lang=#{lang}", {}, "api")
end end
private private
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment