注册报500

dev_aliyun
daiao 5 years ago
parent 3e1aaa0f00
commit 0e9c65deb0

@ -33,7 +33,7 @@ module Mobile
if params[:edu] if params[:edu]
Rails.logger.info("####11111222##{@env['HTTP_X_REAL_IP']}") Rails.logger.info("####11111222##{@env['HTTP_X_REAL_IP']}")
ip = @env['HTTP_X_REAL_IP'] ip = @env['HTTP_X_REAL_IP']
ua = UserAgent.where(:ip => ip) ua = UserAgent.find_by_ip(ip)
if ua.blank? if ua.blank?
UserAgent.create!(:key => params[:edu].strip, :ip => ip, :type => UserAgent::AD) UserAgent.create!(:key => params[:edu].strip, :ip => ip, :type => UserAgent::AD)
end end

@ -379,7 +379,7 @@ class AccountController < ApplicationController
@user = us.register user_params.merge(:should_confirmation_password => false) @user = us.register user_params.merge(:should_confirmation_password => false)
# 注册时,记录是否是引流用户 # 注册时,记录是否是引流用户
ip = request.remote_ip ip = request.remote_ip
ua = UserAgent.find_by_id(:ip => ip) ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::REGISTER) if ua ua.update_column(:type, UserAgent::REGISTER) if ua
if !@user.new_record? if !@user.new_record?
self.logged_user = @user self.logged_user = @user

@ -349,7 +349,7 @@ class CompetitionTeamsController < ApplicationController
def record_agent_user_action def record_agent_user_action
# 注册时,记录是否是引流用户 # 注册时,记录是否是引流用户
ip = request.remote_ip ip = request.remote_ip
ua = UserAgent.find_by_id(:ip => ip) ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::COMPETITION) if ua ua.update_column(:type, UserAgent::COMPETITION) if ua
end end
end end

Loading…
Cancel
Save