Skip to content

Commit 61d4efd

Browse files
committed
revert(axios): remove baseUrl config
无需 baseUrl 配置,已有apiUrl 替代
1 parent d5f9919 commit 61d4efd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/utils/http/axios/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ const transform: AxiosTransform = {
8080

8181
// 请求之前处理config
8282
beforeRequestHook: (config, options) => {
83-
const { baseURL } = config;
8483
const { apiUrl, joinPrefix, joinParamsToUrl, formatDate, joinTime = true } = options;
8584

8685
if (joinPrefix) {
@@ -90,9 +89,6 @@ const transform: AxiosTransform = {
9089
if (apiUrl && isString(apiUrl)) {
9190
config.url = `${apiUrl}${config.url}`;
9291
}
93-
if (baseURL && isString(baseURL)) {
94-
config.url = `${baseURL}${config.url}`;
95-
}
9692
const params = config.params || {};
9793
if (config.method?.toUpperCase() === RequestEnum.GET) {
9894
if (!isString(params)) {
@@ -190,7 +186,7 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
190186
authenticationScheme: '',
191187
timeout: 10 * 1000,
192188
// 基础接口地址
193-
baseURL: globSetting.apiUrl,
189+
// baseURL: globSetting.apiUrl,
194190
// 接口可能会有通用的地址部分,可以统一抽取出来
195191
urlPrefix: urlPrefix,
196192
headers: { 'Content-Type': ContentTypeEnum.JSON },

0 commit comments

Comments
 (0)