diff --git a/app/api/mobile/apis/new_comment.rb b/app/api/mobile/apis/new_comment.rb index 43d8bde66..cb74efbb5 100644 --- a/app/api/mobile/apis/new_comment.rb +++ b/app/api/mobile/apis/new_comment.rb @@ -44,13 +44,12 @@ module Mobile uri = 'https://api.weixin.qq.com/sns/userinfo?access_token='+access_token+'&openid='+openid+'&lang=zh_CN' userinfo = nil open(uri) do |http| - userinfo = http.read + userinfo = JSON.parse(http.read) end # userinfo = Wechat.api.web_userinfo(access_token,openid) Rails.logger.info userinfo - Rails.logger.info userinfo[:nickname] Rails.logger.info userinfo["nickname"] name = userinfo["nickname"] else