fix: bilibili Cookie overdue (#5783)

This commit is contained in:
Nano 2020-10-03 07:00:34 +08:00 committed by GitHub
parent b61c54ea9a
commit 022433975e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

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(

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(