change ua

This commit is contained in:
pompurin404 2024-08-21 20:23:30 +08:00
parent b18dbbf770
commit 552fa3757d
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)