diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 3ad85d507..3a7096b2a 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -60,7 +60,8 @@ class AccountsController < ApplicationController ua = UserAgent.find_by_ip(ip) ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua successful_authentication(@user) - session[:user_id] = @user.id + # session[:user_id] = @user.id + session[:"#{default_yun_session}"] = @user.id normal_status("注册成功") end rescue Exception => e @@ -158,7 +159,7 @@ class AccountsController < ApplicationController def logout UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip) - session[:user_id] = nil + session[:"#{default_yun_session}"] = nil logout_user render :json => {status: 1, message: "退出成功!"} end diff --git a/app/controllers/concerns/login_helper.rb b/app/controllers/concerns/login_helper.rb index 605d0faf4..cf0c8e1e3 100644 --- a/app/controllers/concerns/login_helper.rb +++ b/app/controllers/concerns/login_helper.rb @@ -47,7 +47,7 @@ module LoginHelper User.current.delete_session_token(session[:tk]) self.logged_user = nil end - session[:user_id] = nil + session[:"#{default_yun_session}"] = nil end # Sets the logged in user diff --git a/app/controllers/oauth/base_controller.rb b/app/controllers/oauth/base_controller.rb index e4068fbda..327f21845 100644 --- a/app/controllers/oauth/base_controller.rb +++ b/app/controllers/oauth/base_controller.rb @@ -12,7 +12,8 @@ class Oauth::BaseController < ActionController::Base private def session_user_id - session[:user_id] + # session[:user_id] + session[:"#{default_yun_session}"] end def current_user diff --git a/app/controllers/weapps/registers_controller.rb b/app/controllers/weapps/registers_controller.rb index 0cbab7fd4..fde0f0583 100644 --- a/app/controllers/weapps/registers_controller.rb +++ b/app/controllers/weapps/registers_controller.rb @@ -48,7 +48,8 @@ class Weapps::RegistersController < Weapps::BaseController ) end successful_authentication(@user) - session[:user_id] = @user.id + # session[:user_id] = @user.id + session[:"#{default_yun_session}"] = @user.id render_ok end