风雷协议区分个人和企业版

This commit is contained in:
xxq250 2024-09-13 15:02:50 +08:00
parent c14824bbfc
commit 3ada004098
3 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,13 @@ class ApplySignaturesController < ApplicationController
file = license.attachments.take file = license.attachments.take
# normal_status(-1, "文件不存在") if file.blank? # normal_status(-1, "文件不存在") if file.blank?
if file.blank? if file.blank?
send_file("#{Rails.root.to_s}/public/#{license_name}-License.docx", filename: "#{license_name}软件开源协议.docx",stream:false, type: 'application/octet-stream') if license_name == "PHengLEI" && ["personal", "enterprise"].include?(params[:license_type].to_s)
path = "#{Rails.root.to_s}/public/#{license_name}-License-#{params[:license_type]}.docx"
file_name = "#{license_name}软件开源协议-#{params[:license_type] == "personal" ? "(个人版)" : "(企业版)"}.docx"
send_file(path, filename: file_name, stream: false, type: 'application/octet-stream')
else
send_file("#{Rails.root.to_s}/public/#{license_name}-License.docx", filename: "#{license_name}软件开源协议.docx", stream: false, type: 'application/octet-stream')
end
else else
send_file(absolute_path(local_path(file)), filename: file.title,stream:false, type: file.content_type.presence || 'application/octet-stream') send_file(absolute_path(local_path(file)), filename: file.title,stream:false, type: file.content_type.presence || 'application/octet-stream')
end end

Binary file not shown.

Binary file not shown.