Commit cd769e78 by Ivan

feat: 更改导出文件使用的域名环境变量

parent 339c10f9
......@@ -2,7 +2,7 @@
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tallty_import_export`. To experiment with that code, run `bin/console` for an interactive prompt.
TODO: Delete this and the text above, and describe your gem
ENV['SOA_FILE_DOWNLOAD_HOST'] 导出文件时使用的域名
## Installation
......@@ -34,7 +34,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tallty_import_export.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
......@@ -281,7 +281,7 @@ module TalltyImportExport
when 'file'
if data.is_a?(Array) && !opts[:keep_array]
data.map do |item|
url = item.dig('url') || (item.dig('downloadPath') ? [ENV['WEBSITE_URL'], item.dig('downloadPath')].join : nil)
url = item.dig('url') || (item.dig('downloadPath') ? [ENV['SOA_FILE_DOWNLOAD_HOST'], item.dig('downloadPath')].join : nil)
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'))}" :
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