From f7ae26f067e87030765212666941e709dcc8be96 Mon Sep 17 00:00:00 2001 From: lengyx Date: Thu, 4 Jan 2018 16:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Domain=20=20cookie=20?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/login.js | 1 + router/loginCellphone.js | 2 +- router/login_refresh.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/router/login.js b/router/login.js index 4b21127..431d3a5 100644 --- a/router/login.js +++ b/router/login.js @@ -25,6 +25,7 @@ router.get('/', (req, res) => { cookie, (music_req, cookie) => { // console.log(music_req) + cookie = cookie&&cookie.map(x => x.replace("Domain=.music.163.com", "")) res.set({ 'Set-Cookie': cookie }) diff --git a/router/loginCellphone.js b/router/loginCellphone.js index 0a0524e..8501217 100644 --- a/router/loginCellphone.js +++ b/router/loginCellphone.js @@ -21,7 +21,7 @@ router.get('/', (req, res) => { cookie, (music_req, cookie) => { // console.log(music_req) - cookie = cookie.map(x => x.replace("Domain=.music.163.com", "")) + cookie = cookie&&cookie.map(x => x.replace("Domain=.music.163.com", "")) res.set({ 'Set-Cookie': cookie }) diff --git a/router/login_refresh.js b/router/login_refresh.js index 397a4e3..0bc99e0 100644 --- a/router/login_refresh.js +++ b/router/login_refresh.js @@ -16,6 +16,7 @@ router.get('/', (req, res) => { cookie, (music_req, cookie) => { console.log({ cookie }) + cookie = cookie&&cookie.map(x => x.replace("Domain=.music.163.com", "")) res.set({ 'Set-Cookie': cookie })