import HttpRequest from '@qg/ui-request';
import { Toast } from '@qg/cherry-ui';
import store from '@/store';
import { appVersion } from '@/service/validation.service';

const http = new HttpRequest(
  {},
  {
    headers: {
      'x-user-terminal': 'H5',
      version: appVersion || '7900'
    }
  },
  function(msg) {
    Toast(msg);
  },
  function(loadingState) {
    store.dispatch('change_loading', loadingState);
  }
).getInstance();
export default http;
