From 63401b10b0fce6b6396d50ca1f42c2141e2a98d0 Mon Sep 17 00:00:00 2001 From: lyp Date: Tue, 26 Aug 2025 17:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=8C=85=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/payment/Payment.tsx | 27 ++++++++++++++++++--------- src/request/request.ts | 8 ++++---- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/components/payment/Payment.tsx b/src/components/payment/Payment.tsx index 217df24..43bf59f 100644 --- a/src/components/payment/Payment.tsx +++ b/src/components/payment/Payment.tsx @@ -1382,19 +1382,28 @@ export default function Payment(props: IPaymentProps) { setBalancePayModal(false); setIsLoading(true); - await balanceBuyPackage(packageInfoId); + const res = await balanceBuyPackage(packageInfoId); + // console.log(res.data); + if (res.data == 'Success') { + getMyPackNum() + setIsLoading(false); + + reloadUser(messageApi, globalDispatchContext).then(() => { + messageApi.success('已购买套餐包'); + }); + setTimeout(() => { + props.handleConfirm(); + }, 1000); + }else{ + setIsLoading(false); + messageApi.error(res.data); + } + - getMyPackNum() - setIsLoading(false); - reloadUser(messageApi, globalDispatchContext).then(() => { - messageApi.success('已购买套餐包'); - }); - setTimeout(() => { - props.handleConfirm(); - }, 1000); } catch (error: any) { // setLoading(false) + if (error.response) { const data = error.response.data; messageApi.open({ diff --git a/src/request/request.ts b/src/request/request.ts index d1901f9..8ff954a 100644 --- a/src/request/request.ts +++ b/src/request/request.ts @@ -18,7 +18,7 @@ import { // 开票功能---------------------------------------------------------------------------- const request = axios.create({ baseURL: operatorPluginBaseUrl, - timeout: 5000, + timeout: 30000, }); request.interceptors.request.use( (config) => { @@ -66,7 +66,7 @@ request.interceptors.response.use( const activityRequset = axios.create({ baseURL: operatorPluginBaseUrl, // baseURL: 'http://192.168.0.115:8099', - timeout: 5000, + timeout: 30000, }); activityRequset.interceptors.request.use( (config) => { @@ -164,7 +164,7 @@ const phoneRequest = axios.create({ baseURL: operatorBaseUrl, // 测试 // baseURL: 'http://192.168.0.115:8091', - timeout: 5000, + timeout: 30000, }); phoneRequest.interceptors.request.use( (config) => { @@ -212,7 +212,7 @@ phoneRequest.interceptors.response.use( // 绑定手机号功能(不要token)---------------------------------------------------------------------------- const newRequest = axios.create({ baseURL: operatorBaseUrl, - timeout: 5000, + timeout: 30000, });