fix(route): douban recommended two-digit month (#14153)
This commit is contained in:
parent
81282775a1
commit
66844b055e
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue