fix: bilibili Cookie overdue (#5783)

This commit is contained in:
Nano
2020-10-03 00:00:34 +01:00
committed by GitHub
parent b61c54ea9a
commit 022433975e
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -9,7 +9,7 @@ module.exports = async (ctx) => {
const cookie = config.bilibili.cookies[uid];
if (cookie === undefined) {
throw Error('缺少对应uid的b站用户登录后的Cookie值');
throw Error('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');
}
const response = await got({
@@ -20,6 +20,9 @@ module.exports = async (ctx) => {
Cookie: cookie,
},
});
if (response.data.code === -6) {
throw Error('对应 uid 的 Bilibili 用户的 Cookie 已过期');
}
const cards = response.data.data.cards;
const out = await Promise.all(
+4 -1
View File
@@ -10,7 +10,7 @@ module.exports = async (ctx) => {
const cookie = config.bilibili.cookies[uid];
if (cookie === undefined) {
throw Error('缺少对应uid的b站用户登录后的Cookie值');
throw Error('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');
}
const response = await got({
@@ -21,6 +21,9 @@ module.exports = async (ctx) => {
Cookie: cookie,
},
});
if (response.data.code === -6) {
throw Error('对应 uid 的 Bilibili 用户的 Cookie 已过期');
}
const cards = response.data.data.cards;
const out = await Promise.all(