|
|
|
@ -6,7 +6,7 @@ module GamesHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 获取目录下所有文件,返回一个文件名的数组 type是查看文件的类型image表示图片
|
|
|
|
|
# type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"]]
|
|
|
|
|
# type [[1, "图片"], [2, "apk/exe"], [3, "txt"], [4, "html"], [5, "mp3"], [6, "mp4"]]
|
|
|
|
|
def get_dir_filename(path, type, game_id)
|
|
|
|
|
answer_picture = []
|
|
|
|
|
return answer_picture unless File.directory?(path)
|
|
|
|
@ -39,6 +39,12 @@ module GamesHelper
|
|
|
|
|
end
|
|
|
|
|
f.close
|
|
|
|
|
@type = 'txt'
|
|
|
|
|
elsif extension == 'mp3' && type == 5
|
|
|
|
|
answer_picture << file
|
|
|
|
|
@type = 'mp3'
|
|
|
|
|
elsif extension == 'mp4' && type == 6
|
|
|
|
|
answer_picture << file
|
|
|
|
|
@type = 'mp4'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|