weixin_guange
guange 9 years ago
parent 8b89d1bc49
commit ea85c0c608

@ -24,6 +24,7 @@ module Mobile
if access_token.present? && refresh_token.present?
refreshinfo = Wechat.api.web_refresh_access_token(refresh_token)
access_token = refreshinfo["access_token"]
refresh_token = refreshinfo["refresh_token"]
session[:access_token] = access_token
@ -38,7 +39,7 @@ module Mobile
name = openid[0..3]+"***"+openid.last
end
user = us.register ({:login=>login, :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)

Loading…
Cancel
Save