@ -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
set_session_openid(result['openid'])
@ -16,7 +16,7 @@ class Weapps::SessionsController < Weapps::BaseController
# 绑定微信号
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)