Fixed some more Typescript issues

This commit is contained in:
Ferdinand Thiessen 2020-10-29 00:10:45 +01:00
parent 9992ed6f2b
commit 5a4f6939d1
3 changed files with 17 additions and 12 deletions

View File

@ -170,12 +170,11 @@ export default defineComponent({
}); });
function logout() { function logout() {
console.log('vor dem logout'); ctx.root.$store
ctx.root.$store.dispatch( .dispatch('user/logout', ctx.root.$store.getters['user/session'].token)
'user/logout', .catch(error => {
ctx.root.$store.getters['user/session'].token console.warn(error);
); });
console.log('nach dem logout');
} }
return { return {

View File

@ -47,9 +47,13 @@ export default defineComponent({
function doLogin() { function doLogin() {
console.log(userid.value, password.value); console.log(userid.value, password.value);
ctx.root.$store.dispatch('user/login', { ctx.root.$store
.dispatch('user/login', {
userid: userid.value, userid: userid.value,
password: password.value password: password.value
})
.catch(error => {
console.warn(error);
}); });
//ctx.root.$router.push({ name: 'main' }); //ctx.root.$router.push({ name: 'main' });
} }

View File

@ -37,7 +37,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from '@vue/composition-api'; import { defineComponent } from '@vue/composition-api';
export default defineComponent({ export default defineComponent({
name: 'Sessions', name: 'Sessions',
props: { props: {
@ -66,7 +66,9 @@ export default defineComponent({
} }
function deleteSession(token: string) { function deleteSession(token: string) {
root.$store.dispatch('sessions/deleteSession', token); root.$store.dispatch('sessions/deleteSession', token).catch(error => {
console.warn(error);
});
} }
function isThisSession(token: string) { function isThisSession(token: string) {
return root.$store.getters['user/session'].token == token; return root.$store.getters['user/session'].token == token;