From d50486693b292eec2df3790a3e07b1cb519af513 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 17 Jul 2019 19:14:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 2 +- app/controllers/competition_teams_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 849999da..d362cde3 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -378,7 +378,7 @@ class AccountController < ApplicationController us = UsersService.new @user = us.register user_params.merge(:should_confirmation_password => false) # 注册时,记录是否是引流用户 - ip = @env['HTTP_X_REAL_IP'] + ip = request.remote_ip ua = UserAgent.find_by_id(:ip => ip) ua.update_column(:type, UserAgent::REGISTER) if ua if !@user.new_record? diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index a269d71e..092426ef 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -348,7 +348,7 @@ class CompetitionTeamsController < ApplicationController def record_agent_user_action # 注册时,记录是否是引流用户 - ip = @env['HTTP_X_REAL_IP'] + ip = request.remote_ip ua = UserAgent.find_by_id(:ip => ip) ua.update_column(:type, UserAgent::COMPETITION) if ua end