完善错误提示
This commit is contained in:
@@ -46,19 +46,19 @@ export async function GET(req: NextRequest) {
|
||||
const separator = rSeparator.split(',').map(code => String.fromCharCode(parseInt(code))).join('')
|
||||
|
||||
switch (format) {
|
||||
case 'json':
|
||||
const body = JSON.stringify(params)
|
||||
return NextResponse.json(body)
|
||||
case 'text':
|
||||
const text = result.data.map(item => {
|
||||
const list = [item.host, item.port]
|
||||
if (item.username && item.password) {
|
||||
list.push(item.username)
|
||||
list.push(item.password)
|
||||
}
|
||||
return list.join(separator)
|
||||
}).join(breaker)
|
||||
return new NextResponse(text)
|
||||
case 'json':
|
||||
const body = JSON.stringify(params)
|
||||
return NextResponse.json(body)
|
||||
case 'text':
|
||||
const text = result.data.map(item => {
|
||||
const list = [item.host, item.port]
|
||||
if (item.username && item.password) {
|
||||
list.push(item.username)
|
||||
list.push(item.password)
|
||||
}
|
||||
return list.join(separator)
|
||||
}).join(breaker)
|
||||
return new NextResponse(text)
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user