From 1932ba766cf5a968e970d3890c8ccd6985f7bd36 Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Sat, 14 Dec 2024 00:33:04 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(api):=20Subscribe=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/services/admin/typings.d.ts | 2 +- apps/admin/services/common/typings.d.ts | 2 +- apps/user/app/(main)/(user)/dashboard/page.tsx | 6 +++--- apps/user/app/(main)/(user)/order/renewal.tsx | 10 +++++----- apps/user/app/(main)/(user)/order/reset-traffic.tsx | 12 ++++++------ apps/user/config/use-global.tsx | 4 ++-- apps/user/services/common/typings.d.ts | 2 +- apps/user/services/user/typings.d.ts | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/admin/services/admin/typings.d.ts b/apps/admin/services/admin/typings.d.ts index 64e07d1..09264b5 100644 --- a/apps/admin/services/admin/typings.d.ts +++ b/apps/admin/services/admin/typings.d.ts @@ -888,7 +888,7 @@ declare namespace API { traffic: number; download: number; upload: number; - mark: string; + token: string; status: number; created_at: number; updated_at: number; diff --git a/apps/admin/services/common/typings.d.ts b/apps/admin/services/common/typings.d.ts index a7bea0e..36b7442 100644 --- a/apps/admin/services/common/typings.d.ts +++ b/apps/admin/services/common/typings.d.ts @@ -445,7 +445,7 @@ declare namespace API { traffic: number; download: number; upload: number; - mark: string; + token: string; status: number; created_at: number; updated_at: number; diff --git a/apps/user/app/(main)/(user)/dashboard/page.tsx b/apps/user/app/(main)/(user)/dashboard/page.tsx index 3e81c59..f7a884b 100644 --- a/apps/user/app/(main)/(user)/dashboard/page.tsx +++ b/apps/user/app/(main)/(user)/dashboard/page.tsx @@ -144,10 +144,10 @@ export default function Page() { - + @@ -184,7 +184,7 @@ export default function Page() { - {getUserSubscribe(item.mark, protocol)?.map((url, index) => ( + {getUserSubscribe(item.token, protocol)?.map((url, index) => (
diff --git a/apps/user/app/(main)/(user)/order/renewal.tsx b/apps/user/app/(main)/(user)/order/renewal.tsx index 018ea89..8881fcf 100644 --- a/apps/user/app/(main)/(user)/order/renewal.tsx +++ b/apps/user/app/(main)/(user)/order/renewal.tsx @@ -21,7 +21,7 @@ import { useEffect, useState, useTransition } from 'react'; import { SubscribeBilling } from '../subscribe/billing'; import { SubscribeDetail } from '../subscribe/detail'; -export default function Renewal({ mark, subscribe }: { mark: string; subscribe: API.Subscribe }) { +export default function Renewal({ token, subscribe }: { token: string; subscribe: API.Subscribe }) { const t = useTranslations('order'); const { getUserInfo } = useGlobalStore(); const [open, setOpen] = useState(false); @@ -31,7 +31,7 @@ export default function Renewal({ mark, subscribe }: { mark: string; subscribe: subscribe_id: subscribe.id, payment: 'balance', coupon: '', - subscribe_mark: mark, + subscribe_token: token, }); const [loading, startTransition] = useTransition(); @@ -56,15 +56,15 @@ export default function Renewal({ mark, subscribe }: { mark: string; subscribe: }); useEffect(() => { - if (subscribe.id && mark) { + if (subscribe.id && token) { setParams((prev) => ({ ...prev, quantity: 1, subscribe_id: subscribe.id, - subscribe_mark: mark, + subscribe_token: token, })); } - }, [subscribe.id, mark]); + }, [subscribe.id, token]); return ( diff --git a/apps/user/app/(main)/(user)/order/reset-traffic.tsx b/apps/user/app/(main)/(user)/order/reset-traffic.tsx index 59f9730..1456ce7 100644 --- a/apps/user/app/(main)/(user)/order/reset-traffic.tsx +++ b/apps/user/app/(main)/(user)/order/reset-traffic.tsx @@ -24,11 +24,11 @@ import { useEffect, useState, useTransition } from 'react'; export default function ResetTraffic({ id, - mark, + token, replacement, }: { id: number; - mark: string; + token: string; replacement?: number; }) { const t = useTranslations('order'); @@ -38,7 +38,7 @@ export default function ResetTraffic({ const [params, setParams] = useState({ subscribe_id: id, payment: 'balance', - subscribe_mark: mark, + subscribe_token: token, }); const [loading, startTransition] = useTransition(); @@ -51,15 +51,15 @@ export default function ResetTraffic({ }); useEffect(() => { - if (id && mark) { + if (id && token) { setParams((prev) => ({ ...prev, quantity: 1, subscribe_id: id, - subscribe_mark: mark, + subscribe_token: token, })); } - }, [id, mark]); + }, [id, token]); if (!replacement) return; diff --git a/apps/user/config/use-global.tsx b/apps/user/config/use-global.tsx index 0902fad..d3861b2 100644 --- a/apps/user/config/use-global.tsx +++ b/apps/user/config/use-global.tsx @@ -83,8 +83,8 @@ export const useGlobalStore = create((set, get) => ({ if (type) return `https://${uuid}.${type}.${domain}`; return `https://${uuid}.${domain}`; } else { - if (type) return `https://${domain}${subscribe_path}?mark=${uuid}&type=${type}`; - return `https://${domain}${subscribe_path}?mark=${uuid}`; + if (type) return `https://${domain}${subscribe_path}?token=${uuid}&type=${type}`; + return `https://${domain}${subscribe_path}?token=${uuid}`; } }); }, diff --git a/apps/user/services/common/typings.d.ts b/apps/user/services/common/typings.d.ts index a7bea0e..36b7442 100644 --- a/apps/user/services/common/typings.d.ts +++ b/apps/user/services/common/typings.d.ts @@ -445,7 +445,7 @@ declare namespace API { traffic: number; download: number; upload: number; - mark: string; + token: string; status: number; created_at: number; updated_at: number; diff --git a/apps/user/services/user/typings.d.ts b/apps/user/services/user/typings.d.ts index 3bd0944..a7361f9 100644 --- a/apps/user/services/user/typings.d.ts +++ b/apps/user/services/user/typings.d.ts @@ -347,7 +347,7 @@ declare namespace API { quantity: number; payment: string; coupon?: string; - subscribe_mark: string; + subscribe_token: string; }; type RenewalOrderResponse = { @@ -356,7 +356,7 @@ declare namespace API { type ResetTrafficOrderRequest = { subscribe_id: number; - subscribe_mark: string; + subscribe_token: string; payment: string; }; @@ -592,7 +592,7 @@ declare namespace API { traffic: number; download: number; upload: number; - mark: string; + token: string; status: number; created_at: number; updated_at: number;