添加timeout超时

This commit is contained in:
lxk0301
2021-01-13 17:18:51 +08:00
parent 6221c27604
commit cc7ecf6381
3 changed files with 7 additions and 3 deletions

View File

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