fix: 修复配额说明重复和undefined问题
- 在editStorageForm中初始化oss_storage_quota_value和oss_quota_unit - 删除重复的旧配额说明块,保留新的当前配额设置显示 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
27
backend/test_expire.js
Normal file
27
backend/test_expire.js
Normal file
@@ -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=== 测试完成 ===');
|
||||
Reference in New Issue
Block a user