From 6c9b29e0764f48edb3ba70e7f30007b47d742f79 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Thu, 10 Dec 2020 16:07:59 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'mcbbs/vending-machine.use?= =?UTF-8?q?r.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mcbbs/vending-machine.user.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mcbbs/vending-machine.user.js b/mcbbs/vending-machine.user.js index 6a4f7ce..0e557bd 100644 --- a/mcbbs/vending-machine.user.js +++ b/mcbbs/vending-machine.user.js @@ -51,6 +51,9 @@ } return stock } + async function updateStatus(message) { + await fetch(`https://reward.yumc.pw/mcbbs/updateStatus/message/${message}`).then(r => r.json()) + } async function lowStockNotify(stock, order_id, goods_amount) { await fetch(`https://reward.yumc.pw/mcbbs/lowStockNotify/stock/${stock}/order_id/${order_id}/goods_amount/${goods_amount}`).then(r => r.json()) } @@ -72,7 +75,9 @@ } } async function sendOrderAction(openFn, back = false) { - let timeoutTask = setTimeout(() => { location.href = '/home.php?mod=magic&action=mybox' }, 90000) + let timeoutTask = setTimeout(() => { location.href = '/home.php?mod=magic&action=mybox' }, 120000) + let messagetext = document.getElementById('messagetext') + updateStatus(messagetext && messagetext.innerText || '') let count = 0 let stock = updateStock() let result = await fetch('https://reward.yumc.pw/mcbbs/needSendOrder').then(r => r.json())