weapp: save user extra info at bind user

dev_sync_trustie
p31729568 5 years ago
parent 434d7023c5
commit 8c69a4dd0f

@ -25,6 +25,8 @@ class Weapps::CodeSessionsController < Weapps::BaseController
end
set_session_unionid(user_info['unionId'])
user_info['nickname'] = user_info['nickName']
session[:wechat_user_extra] = user_info
end
set_session_openid(result['openid'])

@ -16,7 +16,7 @@ class Weapps::SessionsController < Weapps::BaseController
end
# 绑定微信号
OpenUsers::Wechat.create!(user: user, uid: session_unionid) if user.wechat_open_user.blank?
OpenUsers::Wechat.create!(user: user, uid: session_unionid, extra: session[:wechat_user_extra]) if user.wechat_open_user.blank?
successful_authentication(user)
end

Loading…
Cancel
Save