From d99568e4182850baafff8a320f2fdc05bd9b1510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=BB=E5=8B=87=E7=A5=A5?= <237899745@qq.com> Date: Fri, 14 Nov 2025 19:47:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=89=80=E6=9C=89=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容: 1. 文件列表 - 列表视图文件名溢出控制 2. 用户列表 - 用户名和邮箱溢出控制 3. 分享列表 - 文件路径和分享链接溢出控制 所有长文本现在都会正确显示省略号,不会导致UI布局异常 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/check_expire.sql | 19 +++++++++++++++++++ backend/test_expire.js | 27 +++++++++++++++++++++++++++ frontend/app.html | 18 ++++++++++-------- 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 backend/check_expire.sql create mode 100644 backend/test_expire.js diff --git a/backend/check_expire.sql b/backend/check_expire.sql new file mode 100644 index 0000000..b4359f8 --- /dev/null +++ b/backend/check_expire.sql @@ -0,0 +1,19 @@ +SELECT + share_code, + substr(share_path, 1, 30) as path, + created_at, + expires_at, + datetime('now') as current_time, + CASE + WHEN expires_at IS NULL THEN '永久有效' + WHEN expires_at > datetime('now') THEN '未过期' + ELSE '已过期' + END as status, + CASE + WHEN expires_at IS NOT NULL AND expires_at > datetime('now') THEN '通过' + WHEN expires_at IS NULL THEN '通过' + ELSE '拦截' + END as findByCode_result +FROM shares +ORDER BY created_at DESC +LIMIT 10; diff --git a/backend/test_expire.js b/backend/test_expire.js new file mode 100644 index 0000000..77176f2 --- /dev/null +++ b/backend/test_expire.js @@ -0,0 +1,27 @@ +const { ShareDB } = require('./database'); + +// 测试过期验证 +console.log('=== 测试分享过期验证 ===\n'); + +// 获取所有分享 +const { db } = require('./database'); +const allShares = db.prepare('SELECT share_code, created_at, expires_at, datetime("now") as current_time FROM shares LIMIT 5').all(); + +console.log('数据库中的分享:'); +allShares.forEach(share => { + console.log(`\n分享码: ${share.share_code}`); + console.log(`创建时间: ${share.created_at}`); + console.log(`到期时间: ${share.expires_at || '永久'}`); + console.log(`当前时间: ${share.current_time}`); + + if (share.expires_at) { + const isExpired = share.expires_at <= share.current_time; + console.log(`是否过期: ${isExpired ? '是' : '否'}`); + } + + // 测试findByCode + const found = ShareDB.findByCode(share.share_code); + console.log(`findByCode结果: ${found ? '找到' : '未找到(已过滤)'}`); +}); + +console.log('\n=== 测试完成 ==='); diff --git a/frontend/app.html b/frontend/app.html index b544d48..cb5cec3 100644 --- a/frontend/app.html +++ b/frontend/app.html @@ -785,7 +785,7 @@ - {{ file.name }} + {{ file.name }} {{ file.isDirectory ? '-' : file.sizeFormatted }} {{ formatDate(file.modifiedTime) }} @@ -1330,13 +1330,15 @@ {{ u.id }} - - {{ u.username }} - - - + +
+ {{ u.username }} + + + +
- {{ u.email }} + {{ u.email }} 仅本地 仅SFTP @@ -1604,7 +1606,7 @@ - {{ file.name }} + {{ file.name }} {{ file.isDirectory ? '-' : file.sizeFormatted }} {{ formatDate(file.modifiedAt) }}