/*
|
* @Description:
|
* @Author: 王旭
|
* @Date: 2021-11-09 15:41:39
|
* @LastEditTime: 2022-05-17 09:48:18
|
* @LastEditors: 王旭
|
*/
|
// 引入axios并配置
|
import axios from "axios";
|
|
// import store from "./store/index.js";
|
|
// 请求超时时间
|
// axios.defaults.timeout = 3000;
|
// 请求拦截器
|
// axios.interceptors.request.use(
|
// function (config) {
|
// store.commit("showLoading");
|
// var token = window.sessionStorage.getItem("token");
|
// config.headers["X-Access-Token"] = token;
|
// return config;
|
// },
|
// function (error) {
|
// store.commit("hideLoading");
|
// return Promise.reject(error);
|
// }
|
// );
|
|
//响应拦截器
|
// axios.interceptors.response.use(
|
// (response) => {
|
// store.commit("hideLoading");
|
// return response;
|
// },
|
// (error) => {
|
// store.commit("hideLoading");
|
// return Promise.reject(error);
|
// }
|
// );
|
// 给axios配置请求拦截器
|
// axios.interceptors.request.use(
|
// function(config) {
|
// var token = window.sessionStorage.getItem("userId");
|
// config.headers.userId = token;
|
// return config;
|
// },
|
// function(ereor) {
|
// return Promise.reject(ereor);
|
// }
|
// );
|
// 基准路径
|
// axios.defaults.withCredentials = true;
|
// axios.defaults.baseURL = "http://103.135.160.14:8932/jeecg-boot/";
|
|
// axios.defaults.baseURL = "http://103.85.165.98:10800/wh/jeecg-boot/";
|
// axios.defaults.baseURL = "http://192.168.20.53:8062/jeecg-boot/";
|
// axios.defaults.baseURL = `${baseUrl}/jeecg-boot/`;
|
// axios.defaults.baseURL = "http://192.168.11.116:8062/jeecg-boot/";
|
// axios.defaults.baseURL = "http://103.135.160.14:8062/jeecg-boot/";
|
export default axios;
|