refactor(frontend): Rework home layout and user interactions

This commit is contained in:
2026-04-22 16:45:00 +08:00
parent 79f255bf6c
commit 59e87faba9
84 changed files with 8299 additions and 2181 deletions
@@ -376,7 +376,7 @@ const mockHandlers: Record<string, (url: string, options: any) => Promise<any>>
'GET /comment/public/list': async (_url: string, options: any) => {
await delay()
const params = options.params || {}
let comments = mockComments.filter(c => c.videoId === params.videoId)
const comments = mockComments.filter(c => c.videoId === params.videoId)
if (params.sortBy === 'hot') {
comments.sort((a, b) => b.likeCount - a.likeCount)
} else {
@@ -526,7 +526,7 @@ const mockHandlers: Record<string, (url: string, options: any) => Promise<any>>
// 匹配 Mock 处理器
function matchHandler(url: string, method: string): ((url: string, options: any) => Promise<any>) | null {
// 标准化 URL(移除查询参数和 /api 前缀)
let normalizedUrl = url.replace(/^\/api/, '').split('?')[0]
const normalizedUrl = url.replace(/^\/api/, '').split('?')[0]
// 构建匹配模式
const patterns = Object.keys(mockHandlers)