From fc74e714ee5137b0aa913e1f209de7afe80d7c20 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 13 Aug 2016 13:53:21 +0800 Subject: [PATCH] . --- app/api/mobile/apis/new_comment.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/api/mobile/apis/new_comment.rb b/app/api/mobile/apis/new_comment.rb index 09ec28d89..8d713d784 100644 --- a/app/api/mobile/apis/new_comment.rb +++ b/app/api/mobile/apis/new_comment.rb @@ -19,15 +19,10 @@ module Mobile raise "无法获取到openid,请在微信中打开本页面" unless openid us = UsersService.new - userinfo = Wechat.api.user(openid) - name = userinfo["nickname"] - - user = us.register ({:login=>openid, :mail=>login+"@163.com", + user = us.register ({:login=>openid, :mail=>"#{openid}@163.com", :password=>"12345678", :password_confirmation=>"12345678", :should_confirmation_password => true}) - user.update_attributes(:lastname=>name) - raise user.errors.full_messages.first if user.new_record? UserWechat.create!( openid: openid,