import axios from "../../node_modules/.pnpm/axios@1.5.0/node_modules/axios/lib/axios.mjs";
import { ResultEnum } from "../enums/httpEnum.mjs";
import { ErrorPageNameMap } from "../enums/pageEnum.mjs";
import "../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import "../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.mjs";
import "../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import { redirectErrorPage } from "../utils/router.mjs";
import "../store/modules/designStore/designStore.mjs";
import "../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../components/GoSkeleton/index.vue.mjs";
import "../components/GoLoading/index.mjs";
import "../settings/designSetting.mjs";
const axiosInstance = axios.create({
  baseURL: "/",
  timeout: ResultEnum.TIMEOUT
});
axiosInstance.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    Promise.reject(error);
  }
);
axiosInstance.interceptors.response.use(
  (res) => {
    const { code } = res.data;
    if (code === void 0 || code === null)
      return Promise.resolve(res.data);
    if (code === ResultEnum.DATA_SUCCESS)
      return Promise.resolve(res.data);
    if (ErrorPageNameMap.get(code))
      redirectErrorPage(code);
    return Promise.resolve(res.data);
  },
  (err) => {
    Promise.reject(err);
  }
);
export {
  axiosInstance as default
};
