fixed 下载文件类增加xlsx,Makefile可显示

This commit is contained in:
xxq250 2022-12-08 17:15:33 +08:00
parent 983f488177
commit 1c16b74f1b
2 changed files with 202 additions and 202 deletions

View File

@ -10,7 +10,7 @@ module RepositoriesHelper
end
def download_type(str)
default_type = %w(ppt pptx pdf zip 7z rar exe pdb obj idb RData rdata doc docx mpp vsdx dot otf eot ttf woff woff2 mp4 mov wmv flv mpeg avi avchd webm mkv apk)
default_type = %w(ppt pptx pdf zip 7z rar exe pdb obj idb RData rdata doc docx mpp vsdx dot otf eot ttf woff woff2 mp4 mov wmv flv mpeg avi avchd webm mkv apk xlsx xls)
default_type.include?(str&.downcase) || str.blank?
end

View File

@ -1,7 +1,7 @@
if @project.forge?
file_name = entry['name']
file_type = File.extname(file_name.to_s)[1..-1]
direct_download = download_type(file_type)
direct_download = file_name.to_s.downcase.include?("Makefile".downcase) || download_type(file_type)
image_type = image_type?(file_type)
json.name file_name
json.sha entry['sha']