Commit 339c10f9 by Ivan

feat: 文件 baseFileServer 导出增加 WEBSITE_URL

parent 74ec4dbc
...@@ -281,7 +281,7 @@ module TalltyImportExport ...@@ -281,7 +281,7 @@ module TalltyImportExport
when 'file' when 'file'
if data.is_a?(Array) && !opts[:keep_array] if data.is_a?(Array) && !opts[:keep_array]
data.map do |item| data.map do |item|
url = item.dig('url') || item.dig('downloadPath') url = item.dig('url') || (item.dig('downloadPath') ? [ENV['WEBSITE_URL'], item.dig('downloadPath')].join : nil)
url.present? ? url.present? ?
"#{url}?fileName=#{URI.encode_www_form_component(item.dig('fileName'))}&fileSize=#{URI.encode_www_form_component(item.dig('fileSize'))}&mimeType=#{URI.encode_www_form_component(item.dig('mimeType') || item.dig('fileType'))}" : "#{url}?fileName=#{URI.encode_www_form_component(item.dig('fileName'))}&fileSize=#{URI.encode_www_form_component(item.dig('fileSize'))}&mimeType=#{URI.encode_www_form_component(item.dig('mimeType') || item.dig('fileType'))}" :
nil nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment