Skip to content

Commit

Permalink
修复:前端提交 404 页面状态码
Browse files Browse the repository at this point in the history
  • Loading branch information
T authored and T committed Mar 23, 2023
1 parent e6e17bd commit b4165d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ chrome.storage.sync.get("options", async (data) => {
if (!task.url) return
try {
let dom = document.createElement('div')
dom.innerHTML = await (await get(task.url)).text()
let rep = await get(task.url)
if (rep.status != 200) throw new Error(`错误码${ rep.status }`)
dom.innerHTML = await rep.text()
let topic = spider(dom, task.id, task.page)
await postTopicInfo(topic, task.sign)
} catch (error) {
Expand Down

0 comments on commit b4165d8

Please sign in to comment.