diff --git a/.env.production b/.env.production index 0b6befa..0a70917 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ VITE_API = http://110.42.251.190:9898 VITE_API_MT = http://mt.myalger.top -VITE_API_MUSIC = http://myalger.top:4000 +VITE_API_MUSIC = http://110.42.251.190:4100 VITE_API_PROXY = http://110.42.251.190:9856 \ No newline at end of file diff --git a/src/hooks/MusicHook.ts b/src/hooks/MusicHook.ts index 07d15c3..ae48417 100644 --- a/src/hooks/MusicHook.ts +++ b/src/hooks/MusicHook.ts @@ -1,5 +1,6 @@ import { getMusicLrc } from '@/api/music' import { ILyric } from '@/type/lyric' +import { getIsMc } from '@/utils' import { ref } from 'vue' interface ILrcData { @@ -89,6 +90,17 @@ const setAudioTime = (index: any, audio: HTMLAudioElement) => { audio.play() } +const ProxyUrl = + import.meta.env.VITE_API_PROXY + '' || 'http://110.42.251.190:9856' + +const getMusicProxyUrl = (url: string) => { + if (!getIsMc()) { + return url + } + const PUrl = url.split('').join('+') + return `${ProxyUrl}/mc?url=${PUrl}` +} + export { lrcData, lrcArray, @@ -101,4 +113,5 @@ export { setAudioTime, nowTime, allTime, + getMusicProxyUrl, } diff --git a/src/layout/components/PlayBar.vue b/src/layout/components/PlayBar.vue index 093b6cf..37d7e20 100644 --- a/src/layout/components/PlayBar.vue +++ b/src/layout/components/PlayBar.vue @@ -62,12 +62,12 @@ 喜欢 - +