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