update domain

This commit is contained in:
2023-10-22 12:55:58 +08:00
parent 0b971bf4d4
commit 9301dcc0aa
3 changed files with 9 additions and 3 deletions

View File

@@ -231,6 +231,7 @@ function createColumns(): DataTableColumns<SongsInfo> {
type: 'primary', type: 'primary',
size: 'small', size: 'small',
circle: true, circle: true,
loading: isLrcLoading.value == data.key,
onClick: () => OnPlayMusic(data), onClick: () => OnPlayMusic(data),
}, },
{ {
@@ -306,7 +307,9 @@ function OnPlayMusic(song: SongsInfo) {
} }
} }
} }
const isLrcLoading = ref('')
async function GetLyric(song: SongsInfo) { async function GetLyric(song: SongsInfo) {
isLrcLoading.value = song.key
QueryGetAPI<{ lyric: string; tlyric: string }>(SONG_API_URL + 'get-netease-lyric', { id: song.id }) QueryGetAPI<{ lyric: string; tlyric: string }>(SONG_API_URL + 'get-netease-lyric', { id: song.id })
.then((data) => { .then((data) => {
console.log(mergeLyrics(data.data.lyric, data.data.tlyric)) console.log(mergeLyrics(data.data.lyric, data.data.tlyric))
@@ -329,6 +332,9 @@ async function GetLyric(song: SongsInfo) {
lrc: '', lrc: '',
} }
}) })
.finally(() => {
isLrcLoading.value = ''
})
} }
function mergeLyrics(originalLyrics: string, translatedLyrics: string): string { function mergeLyrics(originalLyrics: string, translatedLyrics: string): string {
const originalLines = originalLyrics.split('\n') const originalLines = originalLyrics.split('\n')

View File

@@ -1,7 +1,7 @@
import { ref } from 'vue' import { ref } from 'vue'
const debugAPI = import.meta.env.VITE_DEBUG_API 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) export const isBackendUsable = ref(true)

View File

@@ -14,6 +14,6 @@ defineProps<{
<template> <template>
<NDivider style="margin-top: 10px" /> <NDivider style="margin-top: 10px" />
<ScheduleList v-if="currentData" :schedules="currentData ?? []" :is-self="accountInfo?.id == userInfo?.id" v-bind="$attrs" /> <ScheduleList v-if="currentData" :schedules="currentData ?? []" :is-self="false" v-bind="$attrs" />
<NDivider /> <NDivider />
</template> </template>