mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
client: replace deprecated vue-resource with axios, lint more file
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user