feat: 我的、设置、打印指南页面开发完成
This commit is contained in:
@@ -27,6 +27,8 @@ exports.main = async (event) => {
|
||||
return await handleAdd(userId, event);
|
||||
case 'list':
|
||||
return await handleList(userId, event);
|
||||
case 'count':
|
||||
return await handleCount(userId);
|
||||
default:
|
||||
return { code: -1, message: '未知操作' };
|
||||
}
|
||||
@@ -96,3 +98,9 @@ async function handleList(userId, event) {
|
||||
|
||||
return { code: 0, data: result };
|
||||
}
|
||||
|
||||
async function handleCount(userId) {
|
||||
const collection = db.collection('download_logs');
|
||||
const res = await collection.where({ userId }).count();
|
||||
return { code: 0, data: { count: res.total || 0 } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user