修改提取IP接口里的callPublic调用 & 修复余额支付已完成的状态 & 手机端点击支付增加新窗口

This commit is contained in:
Eamon-meng
2025-12-01 19:18:06 +08:00
parent b0a0b37b19
commit 3a5f4220ad
5 changed files with 17 additions and 73 deletions

View File

@@ -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<CreateChannelsResp[]>('/api/channel/create', params)
return callPublic<CreateChannelsResp[]>('/api/channel/create', params)
}

View File

@@ -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 (
<div className="flex items-center gap-2">
<CheckCircle size={16} className="text-done"/>
<span></span>
</div>
)
}
if (!trade) return <span>-</span>
return (
<div className="flex items-center gap-2">

View File

@@ -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) {

View File

@@ -48,6 +48,7 @@ export function PaymentModal(props: PaymentModalProps) {
console.error('支付状态检查失败:', error)
}
finally {
console.log('进入轮询支付状态')
retries++
if (retries >= maxRetries) {
clearInterval(interval)

View File

@@ -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 - TXT2 - 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"
}
]
```