feat: 逐字歌词

This commit is contained in:
alger
2025-10-11 20:23:54 +08:00
parent 4575e4f26d
commit cb2baeadf5
10 changed files with 877 additions and 367 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ export const getMusicLrc = async (id: number) => {
}
// 获取新的歌词数据
const res = await request.get<ILyric>('/lyric', { params: { id } });
const res = await request.get<ILyric>('/lyric/new', { params: { id } });
// 只有在成功获取新数据后才删除旧缓存并添加新缓存
if (res?.data) {
+3 -2
View File
@@ -90,10 +90,11 @@ export class CacheManager {
musicSources?: string[]
): Promise<void> {
try {
// 深度克隆数据,确保可以被 IndexedDB 存储
await saveData('music_url_cache', {
id,
data: result,
musicSources: musicSources || [],
data: cloneDeep(result),
musicSources: cloneDeep(musicSources || []),
createTime: Date.now()
});
console.log(`缓存音乐URL成功: ${id}`);