完成下载行为记录
This commit is contained in:
parent
79767f4bae
commit
b262e1b432
|
@ -103,9 +103,10 @@ class AttachmentsController < ApplicationController
|
||||||
direct_download_history
|
direct_download_history
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
direct_download_history
|
|
||||||
# 记录用户行为
|
# 记录用户行为
|
||||||
record_user_actions
|
record_user_actions(params[:id])
|
||||||
|
# 直接下载历史版本
|
||||||
|
direct_download_history
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -115,8 +116,12 @@ class AttachmentsController < ApplicationController
|
||||||
redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
|
redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
|
||||||
end
|
end
|
||||||
|
|
||||||
def record_user_actions
|
def record_user_actions id
|
||||||
UserActions.create(:action_id => id, :action_type => "AttachmentHistory", :user_id => User.current.id)
|
if params[:action] == "download_history"
|
||||||
|
UserActions.create(:action_id => id, :action_type => "AttachmentHistory", :user_id => User.current.id) unless id.nil?
|
||||||
|
elsif params[:action] == "download"
|
||||||
|
UserActions.create(:action_id => id, :action_type => "Attachment", :user_id => User.current.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def download
|
def download
|
||||||
|
@ -141,6 +146,8 @@ class AttachmentsController < ApplicationController
|
||||||
direct_download
|
direct_download
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
# 记录用户行为
|
||||||
|
record_user_actions(params[:id])
|
||||||
direct_download
|
direct_download
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue