流量计算的时候添加remote ip

dev_aliyun
jingquan huang 5 years ago
parent 9005cf0bef
commit 400de97019

@ -31,10 +31,10 @@ module Mobile
get ':id' do
# 记录用户流量源
if params[:edu]
ip = request.host
ip = @env['REMOTE_HOST']
ua = UserAgent.find_by_ip(ip)
unless ua
UserAgent.create(:key => params[:edu].strip, :ip => request.host)
UserAgent.create(:key => params[:edu].strip, :ip => ip)
end
end
MemosService.new.show params, current_user

Loading…
Cancel
Save