From fbd969e36b27a6005d24a5ab040e8bd25985123a Mon Sep 17 00:00:00 2001 From: Nzix Date: Mon, 24 Sep 2018 16:40:17 +0800 Subject: [PATCH] make the response of /login/status corresponding to /login --- router/login_status.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/router/login_status.js b/router/login_status.js index 4ad4919..2c916ae 100644 --- a/router/login_status.js +++ b/router/login_status.js @@ -9,12 +9,11 @@ module.exports = (req, res, createWebAPIRequest, request) => { cookie, (music_req, cookie) => { try { - var userInfo = (/var GUser=([^;]+);/g).exec(music_req)[1]; - var bindInfo = (/var GBinds=([^;]+);/g).exec(music_req)[1]; - userInfo = eval(`(${userInfo})`); - userInfo.userBind = eval(`(${bindInfo})`); - userInfo.userBind.forEach((item) => {item.tokenJsonStr = JSON.parse(item.tokenJsonStr)}); - res.send(userInfo); + var profile = (/var GUser=([^;]+);/g).exec(music_req)[1]; + var bindings = (/var GBinds=([^;]+);/g).exec(music_req)[1]; + profile = eval(`(${profile})`); + bindings = eval(`(${bindings})`); + res.send({code: 200,profile: profile, bindings: bindings}); } catch (error) { res.status(502).send("fetch error"); } -- GitLab