fix: get_file_list 默认返回空列表
This commit is contained in:
parent
7bfe74b97f
commit
4ac4da7959
|
@ -50,7 +50,7 @@ class ServerInfoView(APIView):
|
||||||
def get_file_list(file_path):
|
def get_file_list(file_path):
|
||||||
dir_list = os.listdir(file_path)
|
dir_list = os.listdir(file_path)
|
||||||
if not dir_list:
|
if not dir_list:
|
||||||
return
|
return []
|
||||||
else:
|
else:
|
||||||
# 注意,这里使用lambda表达式,将文件按照最后修改时间顺序升序排列
|
# 注意,这里使用lambda表达式,将文件按照最后修改时间顺序升序排列
|
||||||
# os.path.getmtime() 函数是获取文件最后修改时间
|
# os.path.getmtime() 函数是获取文件最后修改时间
|
||||||
|
|
Loading…
Reference in New Issue