Skip to content

Conversation

threedayAAAAA
Copy link
Collaborator

No description provided.

let slug = link
.split('/')
.reverse()
.find(item => item)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么反转?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个反转是因为 url的形式为
leetcode.com/api/xxx/
按/分割后末尾,第一个不为空的字符串就是我要的

}

async function main() {
lcProblemIdMap = await getLcProblemIdMap()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

每次都全量有点浪费时间。 可以每次请求后放一个标识,下次碰到就可以不用重新请求。

参考我的 static/user/generate 代码

@azl397985856 azl397985856 merged commit 5089e22 into main Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants