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

This commit is contained in:
xxq250 2022-12-08 17:15:33 +08:00
parent 1aab51104f
commit 6350d2e5a9
2 changed files with 3 additions and 3 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

@ -2,7 +2,7 @@ if @project.forge?
is_dir = @sub_entries.is_a?(Array)
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']