This commit is contained in:
parent
697e857806
commit
3051b82ac2
|
@ -44,13 +44,12 @@ module Mobile
|
||||||
uri = 'https://api.weixin.qq.com/sns/userinfo?access_token='+access_token+'&openid='+openid+'&lang=zh_CN'
|
uri = 'https://api.weixin.qq.com/sns/userinfo?access_token='+access_token+'&openid='+openid+'&lang=zh_CN'
|
||||||
userinfo = nil
|
userinfo = nil
|
||||||
open(uri) do |http|
|
open(uri) do |http|
|
||||||
userinfo = http.read
|
userinfo = JSON.parse(http.read)
|
||||||
end
|
end
|
||||||
|
|
||||||
# userinfo = Wechat.api.web_userinfo(access_token,openid)
|
# userinfo = Wechat.api.web_userinfo(access_token,openid)
|
||||||
|
|
||||||
Rails.logger.info userinfo
|
Rails.logger.info userinfo
|
||||||
Rails.logger.info userinfo[:nickname]
|
|
||||||
Rails.logger.info userinfo["nickname"]
|
Rails.logger.info userinfo["nickname"]
|
||||||
name = userinfo["nickname"]
|
name = userinfo["nickname"]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue