diff --git a/xian_favor/api.py b/xian_favor/api.py index 23861b3..362af27 100644 --- a/xian_favor/api.py +++ b/xian_favor/api.py @@ -1814,6 +1814,7 @@ INDEX_TEMPLATE = ''' const API_BASE = '/api'; let currentFilter = { type: '', status: '', starred: null, folder_id: null }; let currentSort = { sort_by: '', sort_order: '' }; +let currentItems = []; // 保存当前显示的数据,用于切换显示模式时重新渲染 let currentPage = 1; const pageSize = 20; let allFolders = {}; // 按类型存储文件夹 @@ -2032,6 +2033,7 @@ async function loadItems(page = 1) { const data = await res.json(); if (data.success) { + currentItems = data.data; // 保存数据用于切换显示模式 renderItems(data.data); renderPagination(data.total, page); // 使用API返回的total }