client: replace deprecated vue-resource with axios, lint more file

This commit is contained in:
Matteo Pagliazzi
2017-01-15 20:49:15 +01:00
parent caa546eb62
commit bbffa9830b
21 changed files with 189 additions and 181 deletions

View File

@@ -1,16 +1,15 @@
// TODO verify if it's needed, added because Vuex require Promise in the global scope
// TODO verify if it's needed, added because Axios require Promise in the global scope
// and babel-runtime doesn't affect external libraries
require('babel-polyfill');
import Vue from 'vue';
import VueResource from 'vue-resource';
import axios from 'axios';
import AppComponent from './app';
import router from './router';
import store from './store';
import './filters/registerGlobals';
import i18n from './plugins/i18n';
Vue.use(VueResource);
Vue.use(i18n);
// TODO just for the beginning
@@ -18,8 +17,8 @@ let authSettings = localStorage.getItem('habit-mobile-settings');
if (authSettings) {
authSettings = JSON.parse(authSettings);
Vue.http.headers.common['x-api-user'] = authSettings.auth.apiId;
Vue.http.headers.common['x-api-key'] = authSettings.auth.apiToken;
axios.defaults.headers.common['x-api-user'] = authSettings.auth.apiId;
axios.defaults.headers.common['x-api-key'] = authSettings.auth.apiToken;
}
const app = new Vue({