附件下载

dev_forum
cxt 5 years ago
parent bad0158971
commit 7c21c728de

@ -11,8 +11,6 @@ class AttachmentsController < ApplicationController
def show
# 1. 优先跳到cdn
# 2. 如果没有cdnsend_file
# candown = attachment_candown @file
# tip_exception(403,"您没有权限下载该附件") if !candown
if @file.cloud_url.present?
update_downloads(@file)
redirect_to @file.cloud_url and return
@ -185,7 +183,7 @@ class AttachmentsController < ApplicationController
course = @file.container&.graduation_work&.graduation_task&.course
candown = current_user.member_of_course?(course)
end
tip_exception(409, "您没有权限进入") if course.present? && !candown
tip_exception(403, "您没有权限进入") if course.present? && !candown
end
end
end

Loading…
Cancel
Save