提交 3ce4deaa 编写于 作者: B binaryify 提交者: GitHub

Merge pull request #302 from nondanee/bandage

登录状态查询
//登录状态
module.exports = (req, res, createWebAPIRequest, request) => {
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
createWebAPIRequest(
"music.163.com",
"/",
"GET",
{},
cookie,
(music_req, cookie) => {
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);
},
err => res.status(502).send("fetch error")
);
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册