mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix: support sing-box (#36)
This commit is contained in:
parent
12e8c9a50b
commit
4eeb3458cc
@ -19,17 +19,15 @@ export default () => {
|
|||||||
const { form } = createForm<z.infer<typeof schema>>({
|
const { form } = createForm<z.infer<typeof schema>>({
|
||||||
extend: validator({ schema }),
|
extend: validator({ schema }),
|
||||||
async onSubmit(values) {
|
async onSubmit(values) {
|
||||||
const { hello } = await ky
|
const { ok } = await ky.get(values.url, {
|
||||||
.get(values.url, {
|
headers: values.secret
|
||||||
headers: values.secret
|
? {
|
||||||
? {
|
Authorization: `Bearer ${values.secret}`,
|
||||||
Authorization: `Bearer ${values.secret}`,
|
}
|
||||||
}
|
: {},
|
||||||
: {},
|
})
|
||||||
})
|
|
||||||
.json<{ hello: string }>()
|
|
||||||
|
|
||||||
if (!hello) {
|
if (!ok) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user