diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 07ab97cb5..a6c74818c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -11,8 +11,6 @@ class AttachmentsController < ApplicationController def show # 1. 优先跳到cdn # 2. 如果没有cdn,send_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