forked from Gitlink/forgeplus
风雷协议区分个人和企业版
This commit is contained in:
parent
c14824bbfc
commit
3ada004098
|
@ -22,7 +22,13 @@ class ApplySignaturesController < ApplicationController
|
|||
file = license.attachments.take
|
||||
# normal_status(-1, "文件不存在") 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
|
||||
send_file(absolute_path(local_path(file)), filename: file.title,stream:false, type: file.content_type.presence || 'application/octet-stream')
|
||||
end
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue