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, });