From 4ac4da7959ee11ff287cb46cfabd79d55a3b939d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 19 Dec 2023 20:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20get=5Ffile=5Flist=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=A9=BA=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/monitor/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/monitor/views.py b/apps/monitor/views.py index 1ed2a2fa..42535b6e 100755 --- a/apps/monitor/views.py +++ b/apps/monitor/views.py @@ -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() 函数是获取文件最后修改时间