添加timeout超时

This commit is contained in:
lxk0301
2020-12-07 09:46:35 +08:00
parent d1a9980322
commit 4847f1c44b
4 changed files with 11 additions and 5 deletions

View File

@@ -501,7 +501,7 @@ async function plantBeanIndex() {
$.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody
}
function readShareCode() {
return new Promise(resolve => {
return new Promise(async resolve => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/bean/read/${randomCount}/`}, (err, resp, data) => {
try {
if (err) {
@@ -519,6 +519,8 @@ function readShareCode() {
resolve(data);
}
})
await $.wait(15000);
resolve()
})
}
//格式化助力码