|
|
@ -28,6 +28,7 @@ class AttachmentsController < ApplicationController
|
|
|
|
def create
|
|
|
|
def create
|
|
|
|
# 1. 本地存储
|
|
|
|
# 1. 本地存储
|
|
|
|
# 2. 上传到云
|
|
|
|
# 2. 上传到云
|
|
|
|
|
|
|
|
begin
|
|
|
|
upload_file = params["file"] || params["#{params[:file_param_name]}"] # 这里的file_param_name是为了方便其他插件名称
|
|
|
|
upload_file = params["file"] || params["#{params[:file_param_name]}"] # 这里的file_param_name是为了方便其他插件名称
|
|
|
|
uid_logger("#########################file_params####{params["#{params[:file_param_name]}"]}")
|
|
|
|
uid_logger("#########################file_params####{params["#{params[:file_param_name]}"]}")
|
|
|
|
raise "未上传文件" unless upload_file
|
|
|
|
raise "未上传文件" unless upload_file
|
|
|
@ -74,6 +75,10 @@ class AttachmentsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
render_json
|
|
|
|
render_json
|
|
|
|
|
|
|
|
rescue => e
|
|
|
|
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
|
|
|
|
tip_exception(e.message)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
def destroy
|
|
|
|