From ac3a529c460d5b75fe3827a29d22e761758c5508 Mon Sep 17 00:00:00 2001 From: LeafYeeXYZ Date: Sun, 25 Feb 2024 17:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B6=85=E6=97=B6=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.js b/main.js index 945996f..c1ad696 100644 --- a/main.js +++ b/main.js @@ -8,6 +8,10 @@ const container = document.querySelector('.container') // 提交函数 async function generateImage() { try { + // 设置超时 + setTimeout(() => { + throw new Error('请求超时') + }, 30000) // 禁用按钮 submit.disabled = true submit.textContent = '生成中...'