diff --git a/src/electron/main.ts b/src/electron/main.ts index 2496d467..7205c77a 100644 --- a/src/electron/main.ts +++ b/src/electron/main.ts @@ -11,7 +11,14 @@ export const App = app // Scheme must be registered before the app is ready protocol.registerSchemesAsPrivileged([ - { scheme: 'app', privileges: { secure: true, standard: true } } + { + scheme: 'app', + privileges: { + secure: true, + standard: true, + corsEnabled: true + } + } ]) function createWindow() { diff --git a/src/pages/footer/components/music-controller/index.tsx b/src/pages/footer/components/music-controller/index.tsx index dd2642eb..c4490567 100644 --- a/src/pages/footer/components/music-controller/index.tsx +++ b/src/pages/footer/components/music-controller/index.tsx @@ -169,16 +169,6 @@ export const MusicControl = defineComponent({ } ) - // When re-entering, set the playback link of the song - const stopUnWatchMusic = watchEffect(() => { - if (music && music.value) { - useMutations(FooterMutations.SET_MUSIC_URL, music.value.url) - nextTick(() => { - stopUnWatchMusic() - }) - } - }) - const loadstart = () => { block.value = [] } @@ -205,6 +195,9 @@ export const MusicControl = defineComponent({ } onMounted(() => { + if (music && music.value) { + useMutations(FooterMutations.SET_MUSIC_URL, music.value.url) + } if (audioElement.value && sourceElement.value) { audioElement.value.addEventListener('loadedmetadata', loadedmetadata) audioElement.value.addEventListener('canplaythrough', canplaythrough) diff --git a/src/pages/header/component/setting.tsx b/src/pages/header/component/setting.tsx index 4e364116..5e85fa4d 100644 --- a/src/pages/header/component/setting.tsx +++ b/src/pages/header/component/setting.tsx @@ -38,7 +38,8 @@ const setColor = (baseColor: string) => { export const Setting = defineComponent({ name: 'Setting', setup() { - const themeColor = useThemeColor() + // eslint-disable-next-line prefer-const + let themeColor = useThemeColor() const visibleColor = ref(false) onMounted(() => { diff --git a/src/utils/http.ts b/src/utils/http.ts index fdea1b53..d732e148 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -13,6 +13,7 @@ const baseURL = isDevelopment : VUE_APP_CI_BASE_URL || VUE_APP_BUILD_BASE_URL const http: AxiosInstance = Axios.create({ + withCredentials: true, baseURL: baseURL, timeout: 20000 })