Revert "fix: 修复 request 初始化问题 (#198)"

This reverts commit ae412e7308bc39ef78699b0050eb11a41080c56b.
This commit is contained in:
qlin 2023-06-14 15:38:38 +08:00 committed by GitHub
parent 68e15ada4f
commit 421be6c19e

View File

@ -15,7 +15,7 @@ function getRequestInstance() {
return createRequest(defaultConfig);
}
let currentRequest;
const currentRequest = getRequestInstance();
export const rawRequest = (url, data, options = {}) => {
if (typeof options === 'string') {
@ -23,9 +23,6 @@ export const rawRequest = (url, data, options = {}) => {
method: options,
};
}
if (!currentRequest) {
currentRequest = getRequestInstance();
}
return currentRequest(url, data, options);
};