fix(route): douban recommended two-digit month (#14153)

This commit is contained in:
Summer⛱ 2024-01-01 22:36:49 +08:00 committed by GitHub
parent 81282775a1
commit 66844b055e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,9 @@ module.exports = async (ctx) => {
const date = new Date();
const year = date.getFullYear();
const mon = date.getMonth() + 1;
const month = date.getMonth() + 1;
const mon = month < 10 ? '0' + month : month.toString();
let items = response.data.data[0].items;
const subjectCollectionId = items.find((item) => item.title.startsWith(`${year}${mon}`)).id;