mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 13:10:30 +08:00
specify response type
This commit is contained in:
parent
35d2a10a62
commit
23e773ded2
@ -75,7 +75,8 @@ export async function createOverride(item: Partial<IOverrideItem>): Promise<IOve
|
|||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: mixedPort
|
port: mixedPort
|
||||||
}
|
},
|
||||||
|
responseType: 'text'
|
||||||
})
|
})
|
||||||
const data = res.data
|
const data = res.data
|
||||||
await setOverride(id, newItem.ext, data)
|
await setOverride(id, newItem.ext, data)
|
||||||
|
|||||||
@ -132,7 +132,8 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
|||||||
res = await axios.get(urlObj.toString(), {
|
res = await axios.get(urlObj.toString(), {
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': userAgent || 'clash.meta'
|
'User-Agent': userAgent || 'clash.meta'
|
||||||
}
|
},
|
||||||
|
responseType: 'text'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
res = await axios.get(item.url, {
|
res = await axios.get(item.url, {
|
||||||
@ -145,7 +146,8 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
|||||||
: false,
|
: false,
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': userAgent || 'clash.meta'
|
'User-Agent': userAgent || 'clash.meta'
|
||||||
}
|
},
|
||||||
|
responseType: 'text'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import { getAppConfig } from '../config'
|
|||||||
export async function subStoreSubs(): Promise<ISubStoreSub[]> {
|
export async function subStoreSubs(): Promise<ISubStoreSub[]> {
|
||||||
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
||||||
const baseUrl = useCustomSubStore ? customSubStoreUrl : `http://127.0.0.1:${subStorePort}`
|
const baseUrl = useCustomSubStore ? customSubStoreUrl : `http://127.0.0.1:${subStorePort}`
|
||||||
const res = await axios.get(`${baseUrl}/api/subs`)
|
const res = await axios.get(`${baseUrl}/api/subs`, { responseType: 'json' })
|
||||||
return res.data.data as ISubStoreSub[]
|
return res.data.data as ISubStoreSub[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function subStoreCollections(): Promise<ISubStoreSub[]> {
|
export async function subStoreCollections(): Promise<ISubStoreSub[]> {
|
||||||
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
||||||
const baseUrl = useCustomSubStore ? customSubStoreUrl : `http://127.0.0.1:${subStorePort}`
|
const baseUrl = useCustomSubStore ? customSubStoreUrl : `http://127.0.0.1:${subStorePort}`
|
||||||
const res = await axios.get(`${baseUrl}/api/collections`)
|
const res = await axios.get(`${baseUrl}/api/collections`, { responseType: 'json' })
|
||||||
return res.data.data as ISubStoreSub[]
|
return res.data.data as ISubStoreSub[]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,8 @@ export async function checkUpdate(): Promise<IAppVersion | undefined> {
|
|||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: mixedPort
|
port: mixedPort
|
||||||
}
|
},
|
||||||
|
responseType: 'text'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const latest = yaml.parse(res.data, { merge: true }) as IAppVersion
|
const latest = yaml.parse(res.data, { merge: true }) as IAppVersion
|
||||||
|
|||||||
@ -20,7 +20,8 @@ async function listGists(token: string): Promise<GistInfo[]> {
|
|||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port
|
port
|
||||||
}
|
},
|
||||||
|
responseType: 'json'
|
||||||
})
|
})
|
||||||
return res.data as GistInfo[]
|
return res.data as GistInfo[]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user