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

This commit is contained in:
Summer⛱
2024-01-01 14:36:49 +00:00
committed by GitHub
parent 81282775a1
commit 66844b055e
+3 -1
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;