添加timeout超时

This commit is contained in:
lxk0301
2021-01-13 17:18:51 +08:00
parent 6a74c16117
commit 156f21f68f
3 changed files with 7 additions and 3 deletions

View File

@@ -1300,7 +1300,7 @@ async function showMsg() {
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/jxfactory/read/${randomCount}/`}, (err, resp, data) => {
$.get({url: `http://api.turinglabs.net/api/v1/jd/jxfactory/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)