From bc58efa397544352ad815a3de2e4e95bdc375af9 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 10 Apr 2024 09:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=BA=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 46810007b..c824b6ce3 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -127,7 +127,7 @@ class AttachmentsController < ApplicationController # 附件为视频时,点击播放 def preview_attachment - attachment = Attachment.find_by(id: params[:id]) + attachment = Attachment.where_id_or_uuid(params[:id]).first dir_path = "#{Rails.root}/public/preview" Dir.mkdir(dir_path) unless Dir.exist?(dir_path) if params[:status] == "preview"