feat: 3.5版本规划

This commit is contained in:
R524809
2026-09-24 17:14:38 +08:00
parent f82ac4d89d
commit 08d9a2792a
19 changed files with 769 additions and 45 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ function toHomeDisplayItem(ws) {
ageBand: ageBand(ws.ageMin || 0, ws.ageMax || 0),
difficulty: DIFFICULTY_LABELS[ws.difficulty] || '基础',
icon: '',
img: ws.previewImg || '',
previewImg: ws.previewImg || '',
badge: ws.isNew ? 'NEW' : ws.isHot ? 'HOT' : '',
path: ws.path || '',
available: true,
+13
View File
@@ -36,13 +36,26 @@ exports.main = async (event) => {
async function handleAdd(userId, event) {
const { worksheetId } = event;
const exportId = String(event.exportId || '').trim();
if (!worksheetId) return { code: -1, message: 'worksheetId 不能为空' };
const collection = db.collection('download_logs');
// 同一次成功导出重试时只能计一次,避免网络重试抬高下载量。
if (exportId) {
const { data: existing } = await collection
.where({ userId, exportId })
.limit(1)
.get();
if (existing.length > 0) {
return { code: 0, data: { ...existing[0], duplicate: true } };
}
}
const record = {
userId,
worksheetId,
...(exportId && { exportId }),
createdAt: db.serverDate(),
};
const { _id } = await collection.add({ data: record });