fix: get_file_list 默认返回空列表

This commit is contained in:
caoqianming 2023-12-19 20:50:20 +08:00
parent 7bfe74b97f
commit 4ac4da7959
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class ServerInfoView(APIView):
def get_file_list(file_path):
dir_list = os.listdir(file_path)
if not dir_list:
return
return []
else:
# 注意这里使用lambda表达式将文件按照最后修改时间顺序升序排列
# os.path.getmtime() 函数是获取文件最后修改时间