2019-06-20 16:04:08 +00:00
|
|
|
<template>
|
2019-08-17 18:21:55 +00:00
|
|
|
<div style="min-height: 100pc;" class="bg">
|
2019-08-11 18:48:02 +00:00
|
|
|
<div class="header2">
|
2019-06-20 16:04:08 +00:00
|
|
|
</div>
|
|
|
|
<v-container grid-list-md>
|
|
|
|
<v-layout row wrap>
|
|
|
|
<v-flex md4></v-flex>
|
2019-08-17 18:21:55 +00:00
|
|
|
<v-flex md4 v-if="!$store.state.loggedIn" style="">
|
|
|
|
<template>
|
|
|
|
<v-card
|
|
|
|
class="mx-auto"
|
|
|
|
>
|
|
|
|
<v-card-title>Login</v-card-title>
|
|
|
|
<v-card-text><Login></Login></v-card-text>
|
|
|
|
</v-card>
|
|
|
|
</template>
|
|
|
|
|
2019-06-20 16:04:08 +00:00
|
|
|
</v-flex>
|
|
|
|
<v-flex md4 v-if="$store.state.loggedIn">
|
2019-08-17 18:21:55 +00:00
|
|
|
<template>
|
|
|
|
<v-card
|
|
|
|
class="mx-auto"
|
|
|
|
>
|
|
|
|
<v-card-title>Login</v-card-title>
|
|
|
|
<v-card-text><p>Hallo {{$store.getters.getMe["username"]}}, du bist bereits eingeloggt.</p></v-card-text>
|
|
|
|
</v-card>
|
|
|
|
</template>
|
|
|
|
|
2019-06-20 16:04:08 +00:00
|
|
|
</v-flex>
|
|
|
|
|
|
|
|
|
2019-08-17 18:21:55 +00:00
|
|
|
|
2019-06-20 16:04:08 +00:00
|
|
|
</v-layout>
|
|
|
|
</v-container>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import ServerService from '../services/Server'
|
|
|
|
import UserService from '../services/User'
|
|
|
|
import LoginComponent from '../components/Login'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
nameBig: '',
|
|
|
|
nameSmall: '',
|
|
|
|
username: '',
|
|
|
|
password: '',
|
|
|
|
errorMessage: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
"Login": LoginComponent
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
'login': function () {
|
|
|
|
UserService.login(this.username, this.password).then((res) => {
|
|
|
|
this.errorMessage = '';
|
|
|
|
UserService.setAccessToken(res.data.data["access_token"]);
|
|
|
|
console.log("Login ok, dispatch event");
|
|
|
|
this.$store.dispatch('checkAccount');
|
|
|
|
}, (res) => {
|
|
|
|
this.errorMessage = res.response.data.msg;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted: function() {
|
|
|
|
console.log("REDIRECT: "+this.$store.state.redirectIfLoggedIn)
|
2019-07-17 12:44:05 +00:00
|
|
|
if(this.$store.state.loggedIn == true) {
|
|
|
|
if(this.$store.state.redirectIfLoggedIn != null) {
|
|
|
|
this.$router.push(this.$store.state.redirectIfLoggedIn);
|
|
|
|
} else {
|
|
|
|
this.$router.push({name: 'Dashboard'});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-06-20 16:04:08 +00:00
|
|
|
}
|
|
|
|
this.nameBig = this.$store.getters.getSettingValue("name_big");
|
|
|
|
this.nameSmall = this.$store.getters.getSettingValue("name_small");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2019-08-17 18:21:55 +00:00
|
|
|
.bg {
|
|
|
|
background-image: url('~@/assets/texture-1485529_1920.jpg');
|
|
|
|
}
|
2019-08-11 18:48:02 +00:00
|
|
|
.header2 {
|
|
|
|
background-image: url('~@/assets/texture-1485529_1920.jpg');
|
2019-06-20 16:04:08 +00:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
margin-top: -100px;
|
2019-08-11 18:48:02 +00:00
|
|
|
height: 50vh;
|
2019-06-20 16:04:08 +00:00
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
.header h1{
|
|
|
|
padding-top: 200px;
|
|
|
|
font-size: 56px !important;
|
|
|
|
font-weight: 400;
|
|
|
|
line-height: 32px !important;
|
|
|
|
letter-spacing: normal !important;
|
|
|
|
}
|
|
|
|
.header h1 .small{
|
|
|
|
font-weight: 300 !important;
|
|
|
|
}
|
|
|
|
.header h2{
|
|
|
|
padding-top: 30px;
|
|
|
|
font-size: 34px !important;
|
|
|
|
font-weight: 300;
|
|
|
|
line-height: 32px !important;
|
|
|
|
letter-spacing: normal !important;
|
|
|
|
}
|
|
|
|
h1{
|
|
|
|
font-weight: 300;
|
|
|
|
line-height: 32px !important;
|
|
|
|
letter-spacing: normal !important;
|
|
|
|
}
|
|
|
|
h2{
|
|
|
|
font-weight: 300;
|
|
|
|
line-height: 32px !important;
|
|
|
|
letter-spacing: normal !important;
|
|
|
|
}
|
|
|
|
</style>
|