From 8c69a4dd0f63fa7ab379702ed51a490e1f4bf9fe Mon Sep 17 00:00:00 2001 From: p31729568 Date: Fri, 25 Oct 2019 09:22:43 +0800 Subject: [PATCH] weapp: save user extra info at bind user --- app/controllers/weapps/code_sessions_controller.rb | 2 ++ app/controllers/weapps/sessions_controller.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/weapps/code_sessions_controller.rb b/app/controllers/weapps/code_sessions_controller.rb index c92c3cb70..887e97eed 100644 --- a/app/controllers/weapps/code_sessions_controller.rb +++ b/app/controllers/weapps/code_sessions_controller.rb @@ -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']) diff --git a/app/controllers/weapps/sessions_controller.rb b/app/controllers/weapps/sessions_controller.rb index 371a3f7d3..8c7c57a7f 100644 --- a/app/controllers/weapps/sessions_controller.rb +++ b/app/controllers/weapps/sessions_controller.rb @@ -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