mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
change ua
This commit is contained in:
parent
b18dbbf770
commit
552fa3757d
@ -108,7 +108,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
|||||||
} as IProfileItem
|
} as IProfileItem
|
||||||
switch (newItem.type) {
|
switch (newItem.type) {
|
||||||
case 'remote': {
|
case 'remote': {
|
||||||
const { userAgent = 'clash-meta' } = await getAppConfig()
|
const { userAgent } = await getAppConfig()
|
||||||
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
|
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
|
||||||
if (!item.url) throw new Error('Empty URL')
|
if (!item.url) throw new Error('Empty URL')
|
||||||
const res = await axios.get(item.url, {
|
const res = await axios.get(item.url, {
|
||||||
@ -120,7 +120,7 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
|||||||
}
|
}
|
||||||
: false,
|
: false,
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': userAgent
|
'User-Agent': userAgent || 'clash.meta'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const data = res.data
|
const data = res.data
|
||||||
|
|||||||
@ -31,7 +31,7 @@ const MihomoConfig: React.FC = () => {
|
|||||||
size="sm"
|
size="sm"
|
||||||
className="w-[60%]"
|
className="w-[60%]"
|
||||||
value={ua}
|
value={ua}
|
||||||
placeholder="默认 clash-meta"
|
placeholder="默认 clash.meta"
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
setUa(v)
|
setUa(v)
|
||||||
setUaDebounce(v)
|
setUaDebounce(v)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user