diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index f9e0e6436..dfa6795fb 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -213,7 +213,6 @@ class HomeworkCommonsController < ApplicationController respond_to do |format| format.xlsx{ cookies[:fileDownload] = true - cookies[:httponly] = false student_work_to_xlsx(@work_excel,@homework) exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals: @@ -237,7 +236,7 @@ class HomeworkCommonsController < ApplicationController if status == 0 respond_to do |format| format.zip{ - cookies.signed[:fileDownload] = { value: true, httponly: false } + cookies[:fileDownload] = true zipfile = zip_homework_common @homework, zip_works file = decode64(zipfile[0][:base64file]) send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip' diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index 209871ad2..bea5784c7 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -11,6 +11,7 @@ class ZipsController < ApplicationController if params[:export].present? && params[:export] normal_status(0,"正在下载中") else + cookies[:fileDownload] = true send_file service.zip, filename: filename_, type: 'application/zip' end