Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

master
杨树明 6 years ago
commit 95293519ea

@ -1264,7 +1264,7 @@ class ExercisesController < ApplicationController
get_export_users(@exercise,@course,@export_ex_users) get_export_users(@exercise,@course,@export_ex_users)
exercise_export_name_ = exercise_export_name_ =
"#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" "#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{exercise_export_name_.strip}",template: "exercises/exercise_lists.xlsx.axlsx",locals: {table_columns:@table_columns,exercise_users:@user_columns},cookies:{fileDownload:true,HttpOnly:false} render xlsx: "#{exercise_export_name_.strip}",template: "exercises/exercise_lists.xlsx.axlsx",locals: {table_columns:@table_columns,exercise_users:@user_columns}
} }
end end
end end
@ -1286,7 +1286,7 @@ class ExercisesController < ApplicationController
if params[:export].present? && params[:export] if params[:export].present? && params[:export]
normal_status(0,"正在下载中") normal_status(0,"正在下载中")
else else
render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets,cookies:{fileDownload:true,HttpOnly:false} render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets
end end
end end

@ -212,10 +212,12 @@ class HomeworkCommonsController < ApplicationController
else else
respond_to do |format| respond_to do |format|
format.xlsx{ format.xlsx{
cookies[:fileDownload] = true
cookies[:httponly] = false
student_work_to_xlsx(@work_excel,@homework) 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')}" 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: render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals:
{table_columns: @work_head_cells,task_users: @work_cells_column},cookies:{fileDownload:true,HttpOnly:false} {table_columns: @work_head_cells,task_users: @work_cells_column}
} }
end end
end end
@ -235,9 +237,10 @@ class HomeworkCommonsController < ApplicationController
if status == 0 if status == 0
respond_to do |format| respond_to do |format|
format.zip{ format.zip{
cookies.signed[:fileDownload] = { value: true, httponly: false }
zipfile = zip_homework_common @homework, zip_works zipfile = zip_homework_common @homework, zip_works
file = decode64(zipfile[0][:base64file]) file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip',cookies:{fileDownload:true,HttpOnly:false} send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
} }
end end
else else

@ -11,7 +11,7 @@ class ZipsController < ApplicationController
if params[:export].present? && params[:export] if params[:export].present? && params[:export]
normal_status(0,"正在下载中") normal_status(0,"正在下载中")
else else
send_file service.zip, filename: filename_, type: 'application/zip',cookies:{fileDownload:true,HttpOnly:false} send_file service.zip, filename: filename_, type: 'application/zip'
end end
rescue BatchExportShixunReportService::Error => ex rescue BatchExportShixunReportService::Error => ex
@ -26,7 +26,7 @@ class ZipsController < ApplicationController
if params[:export].present? && params[:export] if params[:export].present? && params[:export]
normal_status(0,"正在下载中") normal_status(0,"正在下载中")
else else
send_file exercises.ex_zip, filename: file_name_, type: 'application/zip', cookies:{fileDownload:true,HttpOnly:false} send_file exercises.ex_zip, filename: file_name_, type: 'application/zip'
end end
rescue Exception => e rescue Exception => e
normal_status(-1, e.message) normal_status(-1, e.message)

Loading…
Cancel
Save