mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
feat: add ctx.api.fetchHttp method
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user