修复v2提取IP默认方式修改必填类型
This commit is contained in:
@@ -50,6 +50,7 @@ export async function GET(req: NextRequest) {
|
|||||||
const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('')
|
const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('')
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
case '2':
|
||||||
case 'json':
|
case 'json':
|
||||||
if (hostFormat === 'domain') {
|
if (hostFormat === 'domain') {
|
||||||
const domainFormatData = result.data.map(item => ({
|
const domainFormatData = result.data.map(item => ({
|
||||||
@@ -57,6 +58,7 @@ export async function GET(req: NextRequest) {
|
|||||||
port: item.port,
|
port: item.port,
|
||||||
...(item.username && item.password ? {username: item.username, password: item.password} : {}),
|
...(item.username && item.password ? {username: item.username, password: item.password} : {}),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return NextResponse.json(domainFormatData)
|
return NextResponse.json(domainFormatData)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -65,9 +67,12 @@ export async function GET(req: NextRequest) {
|
|||||||
port: item.port,
|
port: item.port,
|
||||||
...(item.username && item.password ? {username: item.username, password: item.password} : {}),
|
...(item.username && item.password ? {username: item.username, password: item.password} : {}),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return NextResponse.json(ipFormatData)
|
return NextResponse.json(ipFormatData)
|
||||||
}
|
}
|
||||||
|
case '1':
|
||||||
case 'text':
|
case 'text':
|
||||||
|
default:
|
||||||
const text = result.data.map((item) => {
|
const text = result.data.map((item) => {
|
||||||
let hostValue: string
|
let hostValue: string
|
||||||
if (hostFormat === 'domain') {
|
if (hostFormat === 'domain') {
|
||||||
|
|||||||
Reference in New Issue
Block a user