postpone the .env problem

This commit is contained in:
j3d1 2019-12-05 22:26:45 +01:00
parent b911b38074
commit c6c98d6aa0
2 changed files with 7 additions and 8 deletions

2
.gitignore vendored
View file

@ -22,3 +22,5 @@ yarn.lock
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
src/store/auth.js

View file

@ -4,8 +4,11 @@ import axios from 'axios';
//import * as _ from 'lodash/fp'; //import * as _ from 'lodash/fp';
import router from '../router'; import router from '../router';
import getAuth from './auth';
Vue.use(Vuex); Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
events: Array, events: Array,
@ -34,10 +37,7 @@ const store = new Vuex.Store({
actions: { actions: {
async loadEvents({ commit }) { async loadEvents({ commit }) {
const resp = await axios.get('https://c3lf.de/api/1/events', { const resp = await axios.get('https://c3lf.de/api/1/events', {
auth: { auth: getAuth(),
username: process.env.VUE_APP_CONFIG_API_USER,
password: process.env.VUE_APP_CONFIG_API_PASSWORD
}
}); });
commit('replaceEvents', resp.data); commit('replaceEvents', resp.data);
@ -48,10 +48,7 @@ const store = new Vuex.Store({
}, },
async loadEventItems({ commit, state }) { async loadEventItems({ commit, state }) {
const resp = await axios.get(`https://c3lf.de/api/1/${state.route.params.event}/items`, { const resp = await axios.get(`https://c3lf.de/api/1/${state.route.params.event}/items`, {
auth: { auth: getAuth(),
username: process.env.VUE_APP_CONFIG_API_USER,
password: process.env.VUE_APP_CONFIG_API_PASSWORD
}
}); });
console.log(resp.data); console.log(resp.data);