From 924448efaacacaf628a0da91485284d1774129bd Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 28 May 2019 15:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E5=87=BA=E8=A1=A5=E4=BA=A4=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 8885353c..464a2842 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -647,7 +647,7 @@ class StudentWorkController < ApplicationController uid: "#{work.user.user_extensions.student_id}", downloadUrl: '' } - attachment = work.attachments.first + attachment = work.attachments.last if attachment o[:downloadUrl] = "https://#{Setting.host_name}/"+download_named_attachment_path(attachment.id, attachment.filename) end