下载url有两处需要处理的

This commit is contained in:
guange 2015-06-24 16:23:15 +08:00
parent 02fa9dc492
commit 38b97aa558
1 changed files with 8 additions and 5 deletions

View File

@ -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+'个学生的作品下载';
}
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="'+ encodeHomeworkUrl(res[i].file) +'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
}
}
@ -911,7 +914,7 @@ $(function(){
else
{
if(res.length==1){
location.href = '/zipdown/download?file='+res[0].file;return;
location.href = encodeHomeworkUrl(res[0].file);return;
}
document.getElementById('light').style.display='block';
$container = $('#light .upload_box_ul');
@ -923,7 +926,7 @@ $(function(){
} else {
des = '第'+res[i].index+'个学生的作品下载';
}
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="/zipdown/download?file='+res[i].file+'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
$('<li><span class="upload_box_span" >'+(i+1)+'.</span> <a href="'+ encodeHomeworkUrl(res[i].file) +'">'+des+'</a><span class="c_grey">&nbsp;&nbsp;(共'+res[i].size+'M</span> </li>').appendTo($container);
}
}