From 391fb6528e8cf9a27ae7a76c002a3cbd418e0ebf Mon Sep 17 00:00:00 2001 From: damienbod Date: Sun, 24 Sep 2023 13:23:25 +0200 Subject: [PATCH] broken component --- ui/src/components/HelloWorld.vue | 41 ++++++++++++++------------------ 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/ui/src/components/HelloWorld.vue b/ui/src/components/HelloWorld.vue index 7784624..ef2adc2 100644 --- a/ui/src/components/HelloWorld.vue +++ b/ui/src/components/HelloWorld.vue @@ -2,14 +2,11 @@ import { ref } from 'vue' import axios from 'axios'; -defineProps<{ msg: string }>() +currentUser: ''; +accessTokenExpired: false; +isLoggedIn: false; -currentUser: string = ''; -accessTokenExpired: boolean | undefined = false; -isLoggedIn: boolean = false; -data: any; - -getDirectApi() { +function getDirectApi() { axios.get(`${this.getCurrentHost()}/api/DirectApi`) .then((response: any) => { this.data = response.data; @@ -17,37 +14,35 @@ getDirectApi() { .catch((error: any) => { alert(error); }); - } -getUserProfile() { +function getUserProfile() { axios.get(`${this.getCurrentHost()}/api/User`) - .then((response: any) => { - this.data = response.data; - }) - .catch((error: any) => { - alert(error); - }); + .then((response: any) => { + this.data = response.data; + }) + .catch((error: any) => { + alert(error); + }); } -getGraphApiDataUsingApi() { - axios.get(`${this.getCurrentHost()}/api/GraphApiData`) +function getGraphApiDataUsingApi() { + axios.get(`${this.getCurrentHost()}/api/GraphApiData`) .then((response: any) => { this.data = response.data; }) .catch((error: any) => { alert(error); - }); + }); } -getCurrentHost() { - const host = window.location.host; - const url = `${window.location.protocol}//${host}`; +function getCurrentHost() { + const host = window.location.host; + const url = `${window.location.protocol}//${host}`; - return url; + return url; } -const count = ref(0)