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',
host: '127.0.0.1',
port: mixedPort
}
},
responseType: 'text'
})
const data = res.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(), {
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'
})
}

View File

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

View File

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

View File

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