diff --git a/public/javascripts/application.js b/public/javascripts/application.js index ba9d205ce..f5d66cd3f 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -950,10 +950,16 @@ $(function(){ return; } - if(res.length<1){ - return; + if (res.err == -2) { + alert("该作业没有任何附件可下载"); + return; } + if(res.length < 1 ){ + alert("该作业没有任何附件可下载"); + return; + } + if(res.length==1){ if(res[0].base64file){ location.href = encodeHomeworkUrl(res[0].base64file, true);return; @@ -983,10 +989,22 @@ $(function(){ $('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) { if(status == 'success'){ var res = JSON.parse(data.responseText); - if(res.length == null){ - alert("该作业没有任何附件可下载"); + + if(res.err == -1){ + var htmlvalue = '
因附件资源太大,请通过微信或者QQ联系Trustie管理员辅助您完成下载
'+ + '确 定