From 3a5f4220ad2999c73e266b5aeb4bdf4a07b0211f Mon Sep 17 00:00:00 2001 From: Eamon-meng <17516219072@163.com> Date: Mon, 1 Dec 2025 19:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E5=8F=96IP=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=87=8C=E7=9A=84callPublic=E8=B0=83=E7=94=A8=20&=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=99=E9=A2=9D=E6=94=AF=E4=BB=98=E5=B7=B2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E7=8A=B6=E6=80=81=20&=20=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E7=82=B9=E5=87=BB=E6=94=AF=E4=BB=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/actions/channel.ts | 4 +- src/app/admin/bills/page.tsx | 8 +++ .../composites/payment/mobile-payment.tsx | 9 ++- .../composites/payment/payment-modal.tsx | 1 + src/components/docs/quickStart.mdx | 68 ------------------- 5 files changed, 17 insertions(+), 73 deletions(-) diff --git a/src/actions/channel.ts b/src/actions/channel.ts index faf846f..bb78496 100644 --- a/src/actions/channel.ts +++ b/src/actions/channel.ts @@ -1,5 +1,5 @@ 'use server' -import {callByUser} from '@/actions/base' +import {callByUser, callPublic} from '@/actions/base' import {Channel} from '@/lib/models' import {PageRecord} from '@/lib/api' @@ -31,5 +31,5 @@ export async function createChannels(params: { city?: string isp?: number }) { - return callByUser('/api/channel/create', params) + return callPublic('/api/channel/create', params) } diff --git a/src/app/admin/bills/page.tsx b/src/app/admin/bills/page.tsx index 10ecfd9..7874285 100644 --- a/src/app/admin/bills/page.tsx +++ b/src/app/admin/bills/page.tsx @@ -203,6 +203,14 @@ export default function BillsPage(props: BillsPageProps) { header: `状态`, cell: ({row}) => { const trade = row.original.trade + if (![1, 2, 3, 4, 5].includes(trade?.method)) { + return ( +
+ + 已完成 +
+ ) + } if (!trade) return - return (
diff --git a/src/components/composites/payment/mobile-payment.tsx b/src/components/composites/payment/mobile-payment.tsx index a29b57f..e554c9f 100644 --- a/src/components/composites/payment/mobile-payment.tsx +++ b/src/components/composites/payment/mobile-payment.tsx @@ -12,10 +12,13 @@ export function MobilePayment(props: PaymentModalProps) { const [paymentInitiated, setPaymentInitiated] = useState(false) // 是否已发起支付 // 处理确认支付 - const handleConfirmPayment = async () => { + const handleConfirmPayment = () => { try { - // 在新窗口打开支付链接 - window.location.href = props.pay_url + const newWindow = window.open(props.pay_url, '_blank') + if (!newWindow) { + toast.error('请允许弹出窗口以完成支付') + return + } setPaymentInitiated(true) } catch (error) { diff --git a/src/components/composites/payment/payment-modal.tsx b/src/components/composites/payment/payment-modal.tsx index 4938c9e..7563198 100644 --- a/src/components/composites/payment/payment-modal.tsx +++ b/src/components/composites/payment/payment-modal.tsx @@ -48,6 +48,7 @@ export function PaymentModal(props: PaymentModalProps) { console.error('支付状态检查失败:', error) } finally { + console.log('进入轮询支付状态') retries++ if (retries >= maxRetries) { clearInterval(interval) diff --git a/src/components/docs/quickStart.mdx b/src/components/docs/quickStart.mdx index edf7e6c..63a8f08 100644 --- a/src/components/docs/quickStart.mdx +++ b/src/components/docs/quickStart.mdx @@ -74,71 +74,3 @@ # # # -# #提取代理接口文档 - -## 请求方式 - -`GET https://lanhuip.com/api/extract` - -## 请求参数 - -| 参数名 | 类型 | 必填 | 描述 | -|--------|----------|------|----------------------------------------------------------------------------------------------------------------------------| -| i | number | 是 | 用于提取的套餐 ID | -| t | number | 是 | 认证类型:1 - 白名单,2 - 密码 | -| a | string | 否 | 归属地省份。默认全局随机 | -| b | string | 否 | 归属地城市。默认全局随机 | -| s | string | 否 | 归属地运营商。默认全局随机 | -| d | string | 否 | 是否去重:1 - 是,0 - 否。默认为是 | -| rt | string | 否 | 返回类型:1 - TXT,2 - JSON。默认 TXT | -| rs | number[] | 否 | 返回时要使用的分隔符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 13,10,即回车 + 换行(\r\n) | -| rb | number[] | 否 | 返回时要使用的换行符,值为该字符的 ascii 编码,可以有多个字符,多个字符用半角逗号连接。默认为 124,即垂直线( \| ) | -| n | number | 否 | 提取数量。默认为 1 | - -## 响应参数 - -如果请求参数中返回类型为 TXT,则响应为纯文本格式,内容为提取的代理列表,每个代理信息占一行。 - -如果请求参数中返回类型为 JSON,则响应为 JSON 格式,内容为提取的代理列表,每个代理信息为一个对象,包含以下字段: - -| 参数名 | 类型 | 描述 | -|----------|--------|--------------------------------------------- | -| host | string | 代理服务器地址 | -| port | number | 代理服务器端口 | -| username | string | 代理服务器用户名(仅在认证类型为密码时返回) | -| password | string | 代理服务器密码(仅在认证类型为密码时返回) | - - -## 示例 - -### 请求示例 - -```http -GET https://lanhuip.com/api/extract?i=1&t=2&a=广东省&b=广州市&s=移动&d=1&rt=2&n=3 -``` - -### 响应示例 - -```json -[ - { - "host": "fwd1.lanhuip.com", - "port": 20000, - "username": "user1", - "password": "pass1" - }, - { - "host": "fwd1.lanhuip.com", - "port": 20001, - "username": "user2", - "password": "pass2" - }, - { - "host": "fwd1.lanhuip.com", - "port": 20002, - "username": "user3", - "password": "pass3" - } -] -``` - \ No newline at end of file