From 63c4bf069ab1f7caa8685c47c25f46b9ac879445 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Tue, 30 Jul 2019 17:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=9A=84ex?= =?UTF-8?q?cel=E5=AF=BC=E5=87=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 3 +-- app/controllers/zips_controller.rb | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) 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