This commit is contained in:
parent
c6020ba819
commit
4c3df301a0
|
|
@ -1,6 +1,6 @@
|
||||||
// import { FetchOptions, $fetch } from "ofetch";
|
// import { FetchOptions, $fetch } from "ofetch";
|
||||||
import ofetch from "ofetch";
|
import { ofetch } from "ofetch"; // ✅ 正确,没有 default,只能这样导入
|
||||||
import type { FetchOptions } from "ofetch"; // 👈 用 `type` 引入类型
|
import type { FetchOptions } from "ofetch"; // ✅ 类型也正确
|
||||||
const $fetch = ofetch;
|
const $fetch = ofetch;
|
||||||
import { RequestCodeEnum, RequestMethodsEnum } from "@/enums/requestEnums";
|
import { RequestCodeEnum, RequestMethodsEnum } from "@/enums/requestEnums";
|
||||||
import feedback from "@/utils/feedback";
|
import feedback from "@/utils/feedback";
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,16 @@
|
||||||
// RequestEventStreamOptions,
|
// RequestEventStreamOptions,
|
||||||
// } from "ofetch";
|
// } from "ofetch";
|
||||||
|
|
||||||
import ofetch from "ofetch";
|
import { ofetch } from "ofetch"; // ✅ 没有 default export
|
||||||
import type {
|
import type {
|
||||||
FetchOptions,
|
FetchOptions,
|
||||||
FetchResponse,
|
FetchResponse,
|
||||||
RequestOptions,
|
RequestOptions,
|
||||||
FileParams,
|
FileParams,
|
||||||
RequestEventStreamOptions
|
RequestEventStreamOptions,
|
||||||
} from "ofetch";
|
} from "ofetch";
|
||||||
|
|
||||||
const $fetch: typeof ofetch = ofetch;
|
const $fetch = ofetch; // ✅ 手动绑定
|
||||||
type $Fetch = typeof ofetch;
|
|
||||||
|
|
||||||
import { merge } from "lodash-es";
|
import { merge } from "lodash-es";
|
||||||
import { isFunction } from "../validate";
|
import { isFunction } from "../validate";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue