提交 a9ab5a27 作者: 陈师旦

fix: 同时请求问题

上级 84005304
import axios from 'axios' // import axios from 'axios'
import { mapHttp } from '/@/utils/http/axios'
import { merge } from 'lodash-es' import { merge } from 'lodash-es'
import { HandlerUtil, defaultStyle, loadMapControl, loadMapboxLibs } from '/@/components/Map/Mapbox' import { HandlerUtil, defaultStyle, loadMapControl, loadMapboxLibs } from '/@/components/Map/Mapbox'
...@@ -8,7 +9,7 @@ import { HandlerUtil, defaultStyle, loadMapControl, loadMapboxLibs } from '/@/co ...@@ -8,7 +9,7 @@ import { HandlerUtil, defaultStyle, loadMapControl, loadMapboxLibs } from '/@/co
// https://juejin.cn/post/7049185827582115870 // https://juejin.cn/post/7049185827582115870
async function request(url, handler) { async function request(url, handler) {
const res = await axios.get(url) const res = await mapHttp.get({ url })
if (handler) { if (handler) {
// TODO: 待优化 // TODO: 待优化
......
...@@ -272,6 +272,13 @@ export const otherHttp = createAxios({ ...@@ -272,6 +272,13 @@ export const otherHttp = createAxios({
urlPrefix: API_URL_PREFIX, urlPrefix: API_URL_PREFIX,
}, },
}) })
export const mapHttp = createAxios({
requestOptions: {
apiUrl: '',
urlPrefix: '',
isReturnNativeResponse: true,
},
})
// export const otherHttp = createAxios({ // export const otherHttp = createAxios({
// transform: { // transform: {
// inject: (config: AxiosRequestConfig<any>, options: http.RequestOptions) => { // inject: (config: AxiosRequestConfig<any>, options: http.RequestOptions) => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论