Skip to content

Commit

Permalink
fix: fix the cookie storage problem on the electron platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkontoask committed Dec 25, 2020
1 parent aeb0217 commit 82f6000
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
9 changes: 8 additions & 1 deletion src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
13 changes: 3 additions & 10 deletions src/pages/footer/components/music-controller/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/pages/header/component/setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
1 change: 1 addition & 0 deletions src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 82f6000

Please sign in to comment.