mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50: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',
|
||||
host: '127.0.0.1',
|
||||
port: mixedPort
|
||||
}
|
||||
},
|
||||
responseType: 'text'
|
||||
})
|
||||
const data = res.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(), {
|
||||
headers: {
|
||||
'User-Agent': userAgent || 'clash.meta'
|
||||
}
|
||||
},
|
||||
responseType: 'text'
|
||||
})
|
||||
} else {
|
||||
res = await axios.get(item.url, {
|
||||
@ -145,7 +146,8 @@ export async function createProfile(item: Partial<IProfileItem>): Promise<IProfi
|
||||
: false,
|
||||
headers: {
|
||||
'User-Agent': userAgent || 'clash.meta'
|
||||
}
|
||||
},
|
||||
responseType: 'text'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -5,13 +5,13 @@ import { getAppConfig } from '../config'
|
||||
export async function subStoreSubs(): Promise<ISubStoreSub[]> {
|
||||
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
||||
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[]
|
||||
}
|
||||
|
||||
export async function subStoreCollections(): Promise<ISubStoreSub[]> {
|
||||
const { useCustomSubStore = false, customSubStoreUrl = '' } = await getAppConfig()
|
||||
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[]
|
||||
}
|
||||
|
||||
@ -20,7 +20,8 @@ export async function checkUpdate(): Promise<IAppVersion | undefined> {
|
||||
protocol: 'http',
|
||||
host: '127.0.0.1',
|
||||
port: mixedPort
|
||||
}
|
||||
},
|
||||
responseType: 'text'
|
||||
}
|
||||
)
|
||||
const latest = yaml.parse(res.data, { merge: true }) as IAppVersion
|
||||
|
||||
@ -20,7 +20,8 @@ async function listGists(token: string): Promise<GistInfo[]> {
|
||||
protocol: 'http',
|
||||
host: '127.0.0.1',
|
||||
port
|
||||
}
|
||||
},
|
||||
responseType: 'json'
|
||||
})
|
||||
return res.data as GistInfo[]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user