diff --git a/public/javascripts/application.js b/public/javascripts/application.js index b90011a4f..ce5a960cf 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -863,6 +863,10 @@ function redo() { window.location.reload() } +function encodeHomeworkUrl(url){ + var file = encodeURI(url).replace(/\+/g, '%2B'); + return '/zipdown/download?file='+file; +} //// 作业附件删除 $(function(){ @@ -880,8 +884,7 @@ $(function(){ } if(res.length==1){ - var file = encodeURI(res[0].file).replace(/\+/g, '%2B'); - location.href = '/zipdown/download?file='+file;return; + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; @@ -894,7 +897,7 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } - $('