specify response type
Some checks failed
Build / windows (arm64) (push) Has been cancelled
Build / windows (ia32) (push) Has been cancelled
Build / windows (x64) (push) Has been cancelled
Build / windows7 (ia32) (push) Has been cancelled
Build / windows7 (x64) (push) Has been cancelled
Build / linux (arm64) (push) Has been cancelled
Build / linux (x64) (push) Has been cancelled
Build / macos (arm64) (push) Has been cancelled
Build / macos (x64) (push) Has been cancelled
Build / macos10 (arm64) (push) Has been cancelled
Build / macos10 (x64) (push) Has been cancelled
Build / aur-git-updater (push) Has been cancelled
Build / artifact-windows (push) Has been cancelled
Build / artifact-windows7 (push) Has been cancelled
Build / artifact-macos (push) Has been cancelled
Build / artifact-macos10 (push) Has been cancelled
Build / artifact-linux (push) Has been cancelled
Build / updater (push) Has been cancelled
Build / aur-release-updater (mihomo-party) (push) Has been cancelled
Build / aur-release-updater (mihomo-party-bin) (push) Has been cancelled
Build / aur-release-updater (mihomo-party-electron) (push) Has been cancelled
Build / aur-release-updater (mihomo-party-electron-bin) (push) Has been cancelled
Build / Update WinGet Package (push) Has been cancelled
Build / Update Homebrew cask (push) Has been cancelled

This commit is contained in:
pompurin404 2024-10-28 21:44:37 +08:00
parent 35d2a10a62
commit 23e773ded2
No known key found for this signature in database
5 changed files with 12 additions and 7 deletions

View File

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

View File

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

View File

@ -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[]
} }

View File

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

View File

@ -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[]
} }