From fd746c25f3acda39f5a73d804b0de4837691beaa Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 22 Dec 2015 16:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E6=94=B9?= =?UTF-8?q?=E4=B8=BAbase64=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0cbe647d6..3d9fba942 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -931,7 +931,10 @@ $(function(){ else { if(res.length==1){ - location.href = encodeHomeworkUrl(res[0].file);return; + if(res[0].base64file){ + location.href = encodeHomeworkUrl(res[0].base64file, true);return; + } + location.href = encodeHomeworkUrl(res[0].file);return; } document.getElementById('light').style.display='block'; $container = $('#light .upload_box_ul'); @@ -943,7 +946,12 @@ $(function(){ } else { des = '第'+res[i].index+'个学生的作品下载'; } + + if(res[i].base64file){ + $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } else { $('
  • '+(i+1)+'. '+des+'  (共'+res[i].size+'M)
  • ').appendTo($container); + } } }