From 7250d05a29bab4177c6fb20ff6c358338878c938 Mon Sep 17 00:00:00 2001 From: Link Date: Sat, 26 Dec 2020 19:03:58 +0800 Subject: [PATCH] style: remove manually adding cookies when logging in --- src/api/index.ts | 6 ++---- src/pages/auth/sage.ts | 10 +++++----- src/pages/footer/api/index.ts | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index 67a44799..cc8067b3 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -4,8 +4,7 @@ import { SongsDetail, SongState, Albums } from '@/interface/index' export const getSongUrl = async (id: number | number[]): Promise => { const data = await get<{ data: T }>('/api/song/url', { id: Array.isArray(id) ? id.join(',') : id, - br: 9.99e5, - timestamp: Date.now() + br: 9.99e5 }) return data.data } @@ -14,8 +13,7 @@ export const getSongDetail = async ( id: number | number[] ): Promise => { const data = await get<{ songs: SongsDetail[] }>('/api/song/detail', { - ids: typeof id === 'number' ? id : id.join(','), - timestamp: Date.now() + ids: typeof id === 'number' ? id : id.join(',') }) return data.songs } diff --git a/src/pages/auth/sage.ts b/src/pages/auth/sage.ts index 2408cd5e..a62625fe 100644 --- a/src/pages/auth/sage.ts +++ b/src/pages/auth/sage.ts @@ -14,11 +14,11 @@ export const mutations = { // Set cookies manually // see https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Set-Cookie // see https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Headers/Content-Security-Policy/block-all-mixed-content - if (info) { - info.cookie.split(';;').forEach(str => { - document.cookie = str - }) - } + // if (info) { + // info.cookie.split(';;').forEach(str => { + // document.cookie = str + // }) + // } state.user = info }, [AUTH_MUTATIONS.LOGOUT]: (state: AuthState) => { diff --git a/src/pages/footer/api/index.ts b/src/pages/footer/api/index.ts index 5f3e9ea6..a691208f 100644 --- a/src/pages/footer/api/index.ts +++ b/src/pages/footer/api/index.ts @@ -4,8 +4,7 @@ export { getSongDetail, getSongUrl } from '@/api/index' export const getLyric = async (id: number): Promise => { const data = await get('/api/lyric', { - id, - timestamp: Date.now() + id }) return data.lrc.lyric }