Browse Source

Add Attachment2

tags/v1.0.0
sylor_huang@126.com 5 years ago
parent
commit
d9f6750797
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

@@ -105,7 +105,7 @@ class AttachmentsController < ApplicationController
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"
if system("cp -r #{absolute_path(local_path(attachment))} #{dir_path}/") if system("cp -r #{absolute_path(local_path(attachment))} #{dir_path}/")
render json: {status: 1, url: "#{dir_path}/#{attachment.disk_filename}"}
render json: {status: 1, url: "/preview/#{attachment.disk_filename}"}
else else
normal_status(-1, "出现错误,请稍后重试") normal_status(-1, "出现错误,请稍后重试")
end end


Loading…
Cancel
Save