From 814aa13c21518c8c463761e09e8c993364ed1c98 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 30 Jul 2019 14:05:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?Mp3=E3=80=81mp4=E7=B1=BB=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/controllers/myshixuns_controller.rb | 2 +- app/helpers/games_helper.rb | 8 +++++++- app/models/challenge.rb | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index b2de6dcad..667d45f2b 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -116,7 +116,7 @@ class GamesController < ApplicationController @qrcode_str = Base64.encode64( qr.to_img.resize(400,400).to_s ) else - @type = "image" + @type = "" #conv = Iconv.new("GBK", "utf-8") @game_challenge = @game.challenge type = @game_challenge.show_type diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index fa47fd7f6..1d6b15969 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -24,7 +24,7 @@ class MyshixunsController < ApplicationController ActiveRecord::Base.transaction do begin @shixun = Shixun.select(:id, :identifier).find(@myshixun.shixun_id) - @myshixun.destroy + @myshixun.destroy! StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0) diff --git a/app/helpers/games_helper.rb b/app/helpers/games_helper.rb index aff05904f..dfc3fb321 100644 --- a/app/helpers/games_helper.rb +++ b/app/helpers/games_helper.rb @@ -6,7 +6,7 @@ module GamesHelper end # 获取目录下所有文件,返回一个文件名的数组 type是查看文件的类型image表示图片 - # type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"]] + # type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"], [5, "mp3"], [6, "mp4"]] def get_dir_filename(path, type, game_id) answer_picture = [] return answer_picture unless File.directory?(path) @@ -39,6 +39,12 @@ module GamesHelper end f.close @type = 'txt' + elsif extension == 'mp3' && type == 5 + answer_picture << file + @type = 'mp3' + elsif extension == 'mp4' && type == 6 + answer_picture << file + @type = 'mp4' end end diff --git a/app/models/challenge.rb b/app/models/challenge.rb index 0bea54eb4..8e4d2ae42 100644 --- a/app/models/challenge.rb +++ b/app/models/challenge.rb @@ -1,5 +1,6 @@ class Challenge < ApplicationRecord # difficulty: 关卡难度: 1.简单 2.中等 3.困难 + # show_type: 效果展示:-1.无效果 1.图片 2.apk/exe 3.txt 4.html 5.mp3 6.mp4 default_scope { order("challenges.position asc") } belongs_to :shixun, :touch => true, counter_cache: true From 3029588c84d06fb260f587f09827b0426ec31d3a Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 31 Jul 2019 09:53:38 +0800 Subject: [PATCH 2/5] + '?export=true' --- .../src/modules/courses/busyWork/common/TabRightComponents.js | 2 +- .../src/modules/courses/exercise/Testpapersettinghomepage.js | 2 +- .../courses/graduation/tasks/GraduationTaskssetting.js | 2 +- .../courses/graduation/tasks/GraduationTaskssettinglist.js | 2 +- .../graduation/tasks/GraduationTaskssettingquestions.js | 2 +- public/react/src/modules/courses/graduation/topics/index.js | 2 +- public/react/src/modules/courses/members/studentsList.js | 2 +- public/react/src/modules/courses/poll/PollDetailIndex.js | 2 +- .../modules/courses/shixunHomework/Listofworksstudentone.js | 2 +- .../src/modules/courses/shixunHomework/ShixunStudentWork.js | 2 +- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 4 ++-- .../modules/courses/shixunHomework/Workquestionandanswer.js | 4 ++-- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js index a070ba69a..5320dd0ca 100644 --- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js +++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js @@ -44,7 +44,7 @@ class TabRightComponents extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true' ).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 36b319f5a..5a410ab4a 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -164,7 +164,7 @@ class Testpapersettinghomepage extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true' ).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 5bbbe1a14..d6382165b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -896,7 +896,7 @@ class GraduationTaskssettingapp extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true' ).then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 7d421da4b..1b98f00f3 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -645,7 +645,7 @@ class GraduationTaskssettinglist extends Component{ b_order:b_order, search:search, } - axios.get(url,{ + axios.get(url + '?export=true',{ params }).then((response) => { if(response === undefined){ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index 1bf6eb962..a812bd803 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -199,7 +199,7 @@ class GraduationTasksquestions extends Component{ /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true').then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index f4303ff87..84b500716 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -322,7 +322,7 @@ onBoardsNew=()=>{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true').then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 6780948ef..d7c4cb85b 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -127,7 +127,7 @@ class studentsList extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '&export=true').then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/poll/PollDetailIndex.js b/public/react/src/modules/courses/poll/PollDetailIndex.js index b1e8c3443..cdc6a5ae2 100644 --- a/public/react/src/modules/courses/poll/PollDetailIndex.js +++ b/public/react/src/modules/courses/poll/PollDetailIndex.js @@ -75,7 +75,7 @@ class PollDetailIndex extends Component{ /// 确认是否下载 confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true' ).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 4dc41fcf7..17778dea9 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2214,7 +2214,7 @@ class Listofworksstudentone extends Component { confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '&export=true').then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 4bb44b697..97bc651ea 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -539,7 +539,7 @@ class ShixunStudentWork extends Component { } confirmysl(url){ - axios.get(url).then((response) => { + axios.get(url + '?export=true').then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index b07392153..8cbf0402f 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1766,12 +1766,12 @@ class Trainingjobsetting extends Component { daochushixunbaogao=()=>{ let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; - this.confirmysl(url); + this.confirmysl(url + '&export=true'); } daochuzuoye =() =>{ let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; - this.confirmysl(url); + this.confirmysl(url + '?export=true'); } confirmysl(url){ diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index a46d783ea..2da08e2ad 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -339,12 +339,12 @@ class Workquestionandanswer extends Component { daochushixunbaogao=()=>{ let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; - this.confirmysl(url); + this.confirmysl(url + '&export=true'); } daochuzuoye =() =>{ let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; - this.confirmysl(url); + this.confirmysl(url + '?export=true'); } confirmysl(url){ From 72cba9fc2888db71b60e9771cc1020d89e482784 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Wed, 31 Jul 2019 09:57:57 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E7=9A=84=E5=85=A8?= =?UTF-8?q?=E9=83=A8excel=E5=AF=BC=E5=87=BA=E5=92=8Cpdf=E5=92=8Czip?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +++ app/controllers/exercises_controller.rb | 2 ++ .../graduation_tasks_controller.rb | 19 +++++++++++++------ .../graduation_topics_controller.rb | 7 ++++++- app/controllers/polls_controller.rb | 3 +++ app/controllers/zips_controller.rb | 1 + 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9ae909dbc..abc3e4856 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1027,7 +1027,10 @@ class CoursesController < ApplicationController tip_exception(403,"无权限操作") elsif @all_members.size == 0 normal_status(-1,"课堂暂时没有学生") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else + set_export_cookies member_to_xlsx(@course, @all_members, @c_homeworks, @c_exercises, @c_tasks) filename_ = "#{current_user.real_name}_#{@course.name}_全部成绩_#{Time.now.strftime('%Y%m%d_%H%M%S')}" render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_scores_excel.xlsx.axlsx", diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 915a4e22c..6f121db5f 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1261,6 +1261,7 @@ class ExercisesController < ApplicationController else respond_to do |format| format.xlsx{ + set_export_cookies get_export_users(@exercise,@course,@export_ex_users) exercise_export_name_ = "#{current_user.real_name}_#{@course.name}_#{@exercise.exercise_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" @@ -1286,6 +1287,7 @@ class ExercisesController < ApplicationController if params[:export].present? && params[:export] normal_status(0,"正在下载中") else + set_export_cookies render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets end end diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index aeb5c409d..0885eeae2 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -132,6 +132,8 @@ class GraduationTasksController < ApplicationController tip_exception(403, "无权限操作") elsif complete_works == 0 normal_status(-1,"暂无用户提交") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ @@ -148,12 +150,17 @@ class GraduationTasksController < ApplicationController zip_works = @work_excel.where("work_status > 0") status = checkfileSize(zip_works) if status == 0 - respond_to do |format| - format.zip{ - zipfile = zip_homework_common @task, zip_works - file = decode64(zipfile[0][:base64file]) - send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip' - } + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + respond_to do |format| + format.zip{ + set_export_cookies + zipfile = zip_homework_common @task, zip_works + file = decode64(zipfile[0][:base64file]) + send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip' + } + end end else normal_status(status,status == -2 ? "500M" : "无附件可下载") diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 96816c2a6..bd93401f3 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -271,7 +271,12 @@ class GraduationTopicsController < ApplicationController students = course.students.joins(user: :user_extension).order("user_extensions.student_id") graduation_topic_to_xlsx(students,course) topic_export_name_ = "#{current_user.real_name}_#{course.name}_毕设选题_#{Time.now.strftime('%Y%m%d_%H%M%S')}" - render xlsx: "#{topic_export_name_.strip}",template: "graduation_topics/export.xlsx.axlsx",locals: {table_columns:@topic_head_cells,topic_users:@topic_body_cells} + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + set_export_cookies + render xlsx: "#{topic_export_name_.strip}",template: "graduation_topics/export.xlsx.axlsx",locals: {table_columns:@topic_head_cells,topic_users:@topic_body_cells} + end rescue Exception => e uid_logger(e.message) missing_template diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 87435f743..7d978d722 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -945,9 +945,12 @@ class PollsController < ApplicationController tip_exception(403,"无权限操作") elsif (@poll.polls_status == 1) || (@poll_export_questions.size == 0) || (@poll_commit_ids.size == 0) normal_status(-1,"暂无用户提交") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ + set_export_cookies polls_export_name_ = "#{current_user.real_name}_#{@course.name}_#{@poll.polls_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" polls_user_commit = poll_commit_result(@poll,@poll_export_questions,@poll_users,@poll_commit_ids) render xlsx: "#{polls_export_name_.strip}",template: "polls/commit_result.xlsx.axlsx",locals: {polls_user_commit:polls_user_commit} diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index b1f7804a9..3ed1eb8b3 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -27,6 +27,7 @@ class ZipsController < ApplicationController if params[:export].present? && params[:export] normal_status(0,"正在下载中") else + set_export_cookies send_file exercises.ex_zip, filename: file_name_, type: 'application/zip' end rescue Exception => e From 8c584ba15d2080559518b2bdcc151452e1f3c1b5 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 31 Jul 2019 09:58:08 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=A4=9A=E5=AA=92?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=E7=9A=84=E5=AE=9E=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/views/games/picture_display.json.jbuilder | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index b2de6dcad..510044aa4 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -116,7 +116,7 @@ class GamesController < ApplicationController @qrcode_str = Base64.encode64( qr.to_img.resize(400,400).to_s ) else - @type = "image" + @type = shixun_show_type @game_challenge.show_type #conv = Iconv.new("GBK", "utf-8") @game_challenge = @game.challenge type = @game_challenge.show_type diff --git a/app/views/games/picture_display.json.jbuilder b/app/views/games/picture_display.json.jbuilder index 541c478a9..b43efa57e 100644 --- a/app/views/games/picture_display.json.jbuilder +++ b/app/views/games/picture_display.json.jbuilder @@ -24,5 +24,30 @@ elsif @type == "txt" json.contents @contents.html_safe elsif @type =="qrcode" json.qrcode_str @qrcode_str +elsif @type == "mp3" || @type == "mp4" + if @type == "mp4" + json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378171/123.mp4"}] + json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378172/456.mp4"}] + json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378173/789.mp4"}] + else + json.orignal_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378174/58099.mp3"}] + json.user_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] + json.answer_file [{"file_url": "http://120.27.231.56:48080/attachments/download/378175/654058514.mp3"}] + end + # json.orignal_file do + # json.array! @orignal_picture do |file| + # json.file_url attachment_show_users_path(:file_name => file, :path => @original_path) + # end + # end + # json.user_file do + # json.array! @user_picture do |file| + # json.file_url attachment_show_users_path(:file_name => file, :path => @user_path, :time => Time.now.to_i) + # end + # end + # json.answer_file do + # json.array! @answer_picture do |file| + # json.file_url attachment_show_users_path(:file_name => file, :path => @answer_path) + # end + # end end \ No newline at end of file From 400e5c104011c1f593daf97092d230fa4acffc37 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Wed, 31 Jul 2019 10:08:01 +0800 Subject: [PATCH 5/5] export true --- .../modules/courses/shixunHomework/Trainingjobsetting.js | 8 ++++---- .../courses/shixunHomework/Workquestionandanswer.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 8cbf0402f..99c295c40 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1766,16 +1766,16 @@ class Trainingjobsetting extends Component { daochushixunbaogao=()=>{ let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; - this.confirmysl(url + '&export=true'); + this.confirmysl(url, url + '&export=true'); } daochuzuoye =() =>{ let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; - this.confirmysl(url + '?export=true'); + this.confirmysl(url, url + '?export=true'); } - confirmysl(url){ - axios.get(url).then((response) => { + confirmysl(url, urlWithExport){ + axios.get(urlWithExport).then((response) => { if(response === undefined){ return } diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 2da08e2ad..4ed45790d 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -339,16 +339,16 @@ class Workquestionandanswer extends Component { daochushixunbaogao=()=>{ let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; - this.confirmysl(url + '&export=true'); + this.confirmysl(url, url + '&export=true'); } daochuzuoye =() =>{ let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; - this.confirmysl(url + '?export=true'); + this.confirmysl(url, url + '?export=true'); } - confirmysl(url){ - axios.get(url).then((response) => { + confirmysl(url, urlWithExport){ + axios.get(urlWithExport).then((response) => { if(response === undefined){ return }