🐛 fix(api): Fix type error in API request and add return URL parameter
This commit is contained in:
@@ -50,7 +50,7 @@ export default function Page() {
|
||||
enabled: !!orderNo && data?.status === 1,
|
||||
queryKey: ['checkoutOrder', orderNo],
|
||||
queryFn: async () => {
|
||||
const { data } = await checkoutOrder({ orderNo: orderNo! });
|
||||
const { data } = await checkoutOrder({ orderNo: orderNo!, returnUrl: window.location.href });
|
||||
return data?.data;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -71,6 +71,7 @@ export default function Purchase({ subscribe, setSubscribe }: Readonly<PurchaseP
|
||||
if (orderNo) {
|
||||
const { data } = await checkoutOrder({
|
||||
orderNo,
|
||||
returnUrl: window.location.href,
|
||||
});
|
||||
const type = data.data?.type;
|
||||
const checkout_url = data.data?.checkout_url;
|
||||
|
||||
@@ -135,6 +135,7 @@ export default function Recharge(props: Readonly<ButtonProps>) {
|
||||
if (orderNo) {
|
||||
const { data } = await checkoutOrder({
|
||||
orderNo,
|
||||
returnUrl: window.location.href,
|
||||
});
|
||||
const type = data.data?.type;
|
||||
const checkout_url = data.data?.checkout_url;
|
||||
|
||||
@@ -79,6 +79,7 @@ export default function Renewal({ id, subscribe }: Readonly<RenewalProps>) {
|
||||
if (orderNo) {
|
||||
const { data } = await checkoutOrder({
|
||||
orderNo,
|
||||
returnUrl: window.location.href,
|
||||
});
|
||||
const type = data.data?.type;
|
||||
const checkout_url = data.data?.checkout_url;
|
||||
|
||||
@@ -86,6 +86,7 @@ export default function ResetTraffic({ id, replacement }: Readonly<ResetTrafficP
|
||||
if (orderNo) {
|
||||
const { data } = await checkoutOrder({
|
||||
orderNo,
|
||||
returnUrl: window.location.href,
|
||||
});
|
||||
const type = data.data?.type;
|
||||
const checkout_url = data.data?.checkout_url;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @ts-ignore
|
||||
|
||||
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as auth from './auth';
|
||||
|
||||
+1
-1
@@ -628,7 +628,7 @@ declare namespace API {
|
||||
type UserDevice = {
|
||||
id: number;
|
||||
ip: string;
|
||||
imei: string;
|
||||
identifier: string;
|
||||
user_agent: string;
|
||||
online: boolean;
|
||||
enabled: boolean;
|
||||
|
||||
Vendored
+2
-1
@@ -91,6 +91,7 @@ declare namespace API {
|
||||
|
||||
type CheckoutOrderRequest = {
|
||||
orderNo: string;
|
||||
returnUrl?: string;
|
||||
};
|
||||
|
||||
type CheckoutOrderResponse = {
|
||||
@@ -828,7 +829,7 @@ declare namespace API {
|
||||
type UserDevice = {
|
||||
id: number;
|
||||
ip: string;
|
||||
imei: string;
|
||||
identifier: string;
|
||||
user_agent: string;
|
||||
online: boolean;
|
||||
enabled: boolean;
|
||||
|
||||
Reference in New Issue
Block a user