import { Store } from 'vuex';
import axios from '@/utils/request';
import { RootState } from '@/store';

const configAxios = () => {
  return (store: Store<RootState>): (() => void) => {
    return Object.defineProperties(store, {
      axios: {
        get() {
          return axios;
        },
      },
      $http: {
        get() {
          return axios;
        },
      },
    });
  };
};

export default configAxios;
