From 9301dcc0aace96535bd8803a2e5731aeb1d204cc Mon Sep 17 00:00:00 2001 From: Megghy Date: Sun, 22 Oct 2023 12:55:58 +0800 Subject: [PATCH] update domain --- src/components/SongList.vue | 8 +++++++- src/data/constants.ts | 2 +- .../view/scheduleTemplate/DefaultScheduleTemplate.vue | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/SongList.vue b/src/components/SongList.vue index 516754b..08a991a 100644 --- a/src/components/SongList.vue +++ b/src/components/SongList.vue @@ -231,6 +231,7 @@ function createColumns(): DataTableColumns { type: 'primary', size: 'small', circle: true, + loading: isLrcLoading.value == data.key, onClick: () => OnPlayMusic(data), }, { @@ -306,7 +307,9 @@ function OnPlayMusic(song: SongsInfo) { } } } +const isLrcLoading = ref('') async function GetLyric(song: SongsInfo) { + isLrcLoading.value = song.key QueryGetAPI<{ lyric: string; tlyric: string }>(SONG_API_URL + 'get-netease-lyric', { id: song.id }) .then((data) => { console.log(mergeLyrics(data.data.lyric, data.data.tlyric)) @@ -329,6 +332,9 @@ async function GetLyric(song: SongsInfo) { lrc: '', } }) + .finally(() => { + isLrcLoading.value = '' + }) } function mergeLyrics(originalLyrics: string, translatedLyrics: string): string { const originalLines = originalLyrics.split('\n') @@ -494,7 +500,7 @@ onMounted(() => { 共 {{ songsComputed.length }} 首
- +
diff --git a/src/data/constants.ts b/src/data/constants.ts index 1f796f9..b708f08 100644 --- a/src/data/constants.ts +++ b/src/data/constants.ts @@ -1,7 +1,7 @@ import { ref } from 'vue' const debugAPI = import.meta.env.VITE_DEBUG_API -const releseAPI = `${document.location.protocol}//api.vtsuru.live/api/` +const releseAPI = `https://vtsuru.suki.club/api/` export const isBackendUsable = ref(true) diff --git a/src/views/view/scheduleTemplate/DefaultScheduleTemplate.vue b/src/views/view/scheduleTemplate/DefaultScheduleTemplate.vue index 9c73f57..be90ca1 100644 --- a/src/views/view/scheduleTemplate/DefaultScheduleTemplate.vue +++ b/src/views/view/scheduleTemplate/DefaultScheduleTemplate.vue @@ -14,6 +14,6 @@ defineProps<{