Compare commits
3 Commits
v1.13.0
...
bdd4424f44
| Author | SHA1 | Date | |
|---|---|---|---|
| bdd4424f44 | |||
| dfaf39e37e | |||
|
|
34f45c8c5a |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lanhu-web",
|
"name": "lanhu-web",
|
||||||
"version": "1.13.0",
|
"version": "1.13.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -H 0.0.0.0 --turbopack",
|
"dev": "next dev -H 0.0.0.0 --turbopack",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use server'
|
'use server'
|
||||||
import {API_BASE_URL, ApiResponse, CLIENT_ID, CLIENT_SECRET} from '@/lib/api'
|
import {API_BASE_URL, ApiResponse, CLIENT_ID, CLIENT_SECRET} from '@/lib/api'
|
||||||
import {add, isBefore} from 'date-fns'
|
import {add, isBefore} from 'date-fns'
|
||||||
|
import {isRedirectError} from 'next/dist/client/components/redirect-error'
|
||||||
import {cookies, headers} from 'next/headers'
|
import {cookies, headers} from 'next/headers'
|
||||||
import {redirect} from 'next/navigation'
|
import {redirect} from 'next/navigation'
|
||||||
import {cache} from 'react'
|
import {cache} from 'react'
|
||||||
@@ -125,7 +126,7 @@ async function call<R = undefined>(url: string, body: RequestInit['body'], auth?
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
return redirect('/login?redirect=' + encodeURIComponent(url.replace(API_BASE_URL, '')))
|
return redirect('/login')
|
||||||
}
|
}
|
||||||
|
|
||||||
const type = response.headers.get('Content-Type') ?? 'text/plain'
|
const type = response.headers.get('Content-Type') ?? 'text/plain'
|
||||||
@@ -169,6 +170,9 @@ async function call<R = undefined>(url: string, body: RequestInit['body'], auth?
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error('后端请求失败', url, (e as Error).message)
|
console.error('后端请求失败', url, (e as Error).message)
|
||||||
|
if (isRedirectError(e)) {
|
||||||
|
throw e
|
||||||
|
}
|
||||||
throw new Error(`请求失败,网络错误`)
|
throw new Error(`请求失败,网络错误`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default function Extract(props: ExtractProps) {
|
|||||||
authType: '1',
|
authType: '1',
|
||||||
count: 1,
|
count: 1,
|
||||||
distinct: '1',
|
distinct: '1',
|
||||||
hostFormat: 'domain',
|
hostFormat: 'ip',
|
||||||
format: 'text',
|
format: 'text',
|
||||||
breaker: '13,10',
|
breaker: '13,10',
|
||||||
separator: '124',
|
separator: '124',
|
||||||
@@ -228,14 +228,14 @@ const FormFields = memo(() => {
|
|||||||
defaultValue={field.value}
|
defaultValue={field.value}
|
||||||
className="flex gap-4"
|
className="flex gap-4"
|
||||||
>
|
>
|
||||||
<FormLabel htmlFor={`${id}-v-domain`} className="px-3 h-10 flex-1 border rounded-md flex items-center text-sm">
|
|
||||||
<RadioGroupItem value="domain" id={`${id}-v-domain`} className="mr-2"/>
|
|
||||||
<span>域名</span>
|
|
||||||
</FormLabel>
|
|
||||||
<FormLabel htmlFor={`${id}-v-ip`} className="px-3 h-10 flex-1 border rounded-md flex items-center text-sm">
|
<FormLabel htmlFor={`${id}-v-ip`} className="px-3 h-10 flex-1 border rounded-md flex items-center text-sm">
|
||||||
<RadioGroupItem value="ip" id={`${id}-v-ip`} className="mr-2"/>
|
<RadioGroupItem value="ip" id={`${id}-v-ip`} className="mr-2"/>
|
||||||
<span>IP</span>
|
<span>IP</span>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
|
<FormLabel htmlFor={`${id}-v-domain`} className="px-3 h-10 flex-1 border rounded-md flex items-center text-sm">
|
||||||
|
<RadioGroupItem value="domain" id={`${id}-v-domain`} className="mr-2"/>
|
||||||
|
<span>域名</span>
|
||||||
|
</FormLabel>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
)}
|
)}
|
||||||
</FormField>
|
</FormField>
|
||||||
|
|||||||
Reference in New Issue
Block a user