fix: 访问日志接口补 pagination 字段(修复埋点Tab总条数显示0)
This commit is contained in:
@@ -74,7 +74,7 @@ router.get('/visits', requirePermission('dashboard:read'), async (req, res) => {
|
|||||||
VisitLog.countDocuments({}),
|
VisitLog.countDocuments({}),
|
||||||
VisitLog.find({}).sort({ createdAt: -1 }).skip((page - 1) * limit).limit(limit).lean(),
|
VisitLog.find({}).sort({ createdAt: -1 }).skip((page - 1) * limit).limit(limit).lean(),
|
||||||
])
|
])
|
||||||
return ApiResponse.success(res, { items, total, page, limit })
|
return ApiResponse.success(res, { items, total, page, limit, pagination: { total } })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('访问日志查询失败:', error)
|
logger.error('访问日志查询失败:', error)
|
||||||
return ApiResponse.serverError(res, error.message)
|
return ApiResponse.serverError(res, error.message)
|
||||||
|
|||||||
Reference in New Issue
Block a user