This commit is contained in:
hailin 2025-07-29 23:37:55 +08:00
parent c6020ba819
commit 4c3df301a0
2 changed files with 5 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// import { FetchOptions, $fetch } from "ofetch";
import ofetch from "ofetch";
import type { FetchOptions } from "ofetch"; // 👈 用 `type` 引入类型
import { ofetch } from "ofetch"; // ✅ 正确,没有 default只能这样导入
import type { FetchOptions } from "ofetch"; // ✅ 类型也正确
const $fetch = ofetch;
import { RequestCodeEnum, RequestMethodsEnum } from "@/enums/requestEnums";
import feedback from "@/utils/feedback";

View File

@ -12,17 +12,16 @@
// RequestEventStreamOptions,
// } from "ofetch";
import ofetch from "ofetch";
import { ofetch } from "ofetch"; // ✅ 没有 default export
import type {
FetchOptions,
FetchResponse,
RequestOptions,
FileParams,
RequestEventStreamOptions
RequestEventStreamOptions,
} from "ofetch";
const $fetch: typeof ofetch = ofetch;
type $Fetch = typeof ofetch;
const $fetch = ofetch; // ✅ 手动绑定
import { merge } from "lodash-es";
import { isFunction } from "../validate";