feat: add ctx.api.fetchHttp method

This commit is contained in:
purocean
2021-12-23 22:44:40 +08:00
parent e03703dd4f
commit b61d44950b
+1 -1
View File
@@ -7,7 +7,7 @@ export type ApiResult<T = any> = {
data: T,
}
async function fetchHttp (input: RequestInfo, init?: RequestInit) {
export async function fetchHttp (input: RequestInfo, init?: RequestInit) {
const response = await fetch(input, init)
if (!response.headers.get('content-type')?.includes('json')) {