perf: 将请求超时和按钮禁用时间从5000毫秒增加到10000毫秒
修改了axios配置和多个页面中的按钮禁用逻辑,延长超时时间以改善用户体验
This commit is contained in:
parent
602c6b6b82
commit
528009e6d5
|
@ -111,7 +111,7 @@ function createRequest(instance: AxiosInstance) {
|
|||
// 请求体
|
||||
data: {},
|
||||
// 请求超时
|
||||
timeout: 5000,
|
||||
timeout: 10000,
|
||||
// 跨域请求时是否携带 Cookies
|
||||
withCredentials: false
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ const handleOpenCabinet = async () => {
|
|||
} finally {
|
||||
setTimeout(() => {
|
||||
isButtonDisabled.value = false
|
||||
}, 5000)
|
||||
}, 10000)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ const handleOpenCell = async (approvalGoodsCellId: number) => {
|
|||
} finally {
|
||||
setTimeout(() => {
|
||||
isButtonDisabled.value = false;
|
||||
}, 5000);
|
||||
}, 10000);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ async function handleOpenCabinet(orderId: number, orderGoodsId: number) {
|
|||
} finally {
|
||||
setTimeout((currentId) => {
|
||||
delete isButtonDisabled.value[currentId]
|
||||
}, 5000, orderGoodsId)
|
||||
}, 10000, orderGoodsId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ async function handleOpenCabinet(item: OrderGoods) {
|
|||
} finally {
|
||||
setTimeout((currentId) => {
|
||||
delete isButtonDisabled.value[currentId]
|
||||
}, 5000, orderGoodsId)
|
||||
}, 10000, orderGoodsId)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue