添加延迟
This commit is contained in:
@@ -676,7 +676,7 @@ function DrawProductionStagePrize() {
|
||||
}
|
||||
async function PickUp(encryptPin = $.encryptPin, help = false) {
|
||||
$.pickUpMyselfComponent = true;
|
||||
const GetUserComponentRes = await GetUserComponent(encryptPin);
|
||||
const GetUserComponentRes = await GetUserComponent(encryptPin, 500);
|
||||
if (GetUserComponentRes && GetUserComponentRes['ret'] === 0) {
|
||||
const { componentList } = GetUserComponentRes['data'];
|
||||
if (componentList && componentList.length <= 0) {
|
||||
@@ -713,8 +713,9 @@ async function PickUp(encryptPin = $.encryptPin, help = false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
function GetUserComponent(pin = $.encryptPin) {
|
||||
function GetUserComponent(pin = $.encryptPin, timeout = 0) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
$.get(taskurl('usermaterial/GetUserComponent', `pin=${pin}`), (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@@ -736,6 +737,7 @@ function GetUserComponent(pin = $.encryptPin) {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
}, timeout)
|
||||
})
|
||||
}
|
||||
//收取地下随机零件电力API
|
||||
|
Reference in New Issue
Block a user