From 54b3113e93baf8b7ebd3bc0a09f131bb6ee80fa5 Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 4 Jun 2025 15:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B5=8F=E8=A7=88=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/dashboard/blueprints/file_browser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/dashboard/blueprints/file_browser.py b/admin/dashboard/blueprints/file_browser.py index c218c52..9adb6f6 100644 --- a/admin/dashboard/blueprints/file_browser.py +++ b/admin/dashboard/blueprints/file_browser.py @@ -37,6 +37,9 @@ def list_files(): "modified": os.path.getmtime(item_path) }) + # 对文件列表进行排序:目录在前,同类型按名称排序 + items.sort(key=lambda x: (not x["is_dir"], x["name"].lower())) + return jsonify({ "success": True, "data": {