From 528009e6d5ea95a57aaa90a2ff22f82b25b0120b Mon Sep 17 00:00:00 2001 From: dzq Date: Mon, 7 Jul 2025 09:58:37 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=B0=86=E8=AF=B7=E6=B1=82=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E5=92=8C=E6=8C=89=E9=92=AE=E7=A6=81=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=BB=8E5000=E6=AF=AB=E7=A7=92=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=B010000=E6=AF=AB=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了axios配置和多个页面中的按钮禁用逻辑,延长超时时间以改善用户体验 --- src/http/axios.ts | 2 +- src/pages/approval/handle.vue | 2 +- src/pages/approval/handleApply.vue | 2 +- src/pages/order/Success.vue | 2 +- src/pages/order/index.vue | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/http/axios.ts b/src/http/axios.ts index 0a9259d..37586f1 100644 --- a/src/http/axios.ts +++ b/src/http/axios.ts @@ -111,7 +111,7 @@ function createRequest(instance: AxiosInstance) { // 请求体 data: {}, // 请求超时 - timeout: 5000, + timeout: 10000, // 跨域请求时是否携带 Cookies withCredentials: false } diff --git a/src/pages/approval/handle.vue b/src/pages/approval/handle.vue index c726b34..b2a7568 100644 --- a/src/pages/approval/handle.vue +++ b/src/pages/approval/handle.vue @@ -217,7 +217,7 @@ const handleOpenCabinet = async () => { } finally { setTimeout(() => { isButtonDisabled.value = false - }, 5000) + }, 10000) } } diff --git a/src/pages/approval/handleApply.vue b/src/pages/approval/handleApply.vue index 1167172..a973cdb 100644 --- a/src/pages/approval/handleApply.vue +++ b/src/pages/approval/handleApply.vue @@ -184,7 +184,7 @@ const handleOpenCell = async (approvalGoodsCellId: number) => { } finally { setTimeout(() => { isButtonDisabled.value = false; - }, 5000); + }, 10000); } }; diff --git a/src/pages/order/Success.vue b/src/pages/order/Success.vue index 9df7998..89dcd33 100644 --- a/src/pages/order/Success.vue +++ b/src/pages/order/Success.vue @@ -41,7 +41,7 @@ async function handleOpenCabinet(orderId: number, orderGoodsId: number) { } finally { setTimeout((currentId) => { delete isButtonDisabled.value[currentId] - }, 5000, orderGoodsId) + }, 10000, orderGoodsId) } } diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue index 09b6e96..74d3b8d 100644 --- a/src/pages/order/index.vue +++ b/src/pages/order/index.vue @@ -90,7 +90,7 @@ async function handleOpenCabinet(item: OrderGoods) { } finally { setTimeout((currentId) => { delete isButtonDisabled.value[currentId] - }, 5000, orderGoodsId) + }, 10000, orderGoodsId) } }