Browse Source

附件为视频时,点击播放

pull/347/head
xxq250 2 years ago
parent
commit
bc58efa397
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/attachments_controller.rb

+ 1
- 1
app/controllers/attachments_controller.rb View File

@@ -127,7 +127,7 @@ class AttachmentsController < ApplicationController


# 附件为视频时,点击播放 # 附件为视频时,点击播放
def preview_attachment 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_path = "#{Rails.root}/public/preview"
Dir.mkdir(dir_path) unless Dir.exist?(dir_path) Dir.mkdir(dir_path) unless Dir.exist?(dir_path)
if params[:status] == "preview" if params[:status] == "preview"


Loading…
Cancel
Save