axios plugin

This commit is contained in:
Jörn-Michael Miehe 2019-05-07 18:03:40 +02:00
parent 640cfe3b03
commit aac6b5e7b4
4 changed files with 9 additions and 10 deletions

View file

@ -27,6 +27,7 @@
<script>
import FormDialog from './FormDialog.vue'
import * as Cookies from 'js-cookie'
import axios from '@/plugins/axios'
export default {
name: 'LoginForm',
@ -43,7 +44,7 @@ export default {
methods: {
confirm() {
window.pkgs.axios
axios
.post('/user/login', {
session: Cookies.get('session'),
login: this.login,

View file

@ -38,6 +38,7 @@
<script>
import FormDialog from './FormDialog.vue'
import axios from '@/plugins/axios'
export default {
name: 'RegisterForm',
@ -67,7 +68,7 @@ export default {
methods: {
confirm() {
window.pkgs.axios
axios
.post('/user/register', {
session: null,
login: this.login,

View file

@ -5,14 +5,6 @@ import router from './router'
import 'roboto-fontface/css/roboto/roboto-fontface.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import axios from 'axios'
axios.defaults.baseURL =
window.location.protocol + '//' + window.location.hostname + ':3001'
window.pkgs = {
axios: axios
}
Vue.config.productionTip = false
new Vue({

View file

@ -0,0 +1,5 @@
import axios from 'axios'
axios.defaults.baseURL =
window.location.protocol + '//' + window.location.hostname + ':3001'
export default axios