From 519ccda5ed27faed062558ea7ee0cc0d53c78b5a Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Tue, 3 Jun 2025 03:11:26 +0800 Subject: [PATCH] Yay! --- src/client.py | 1 - src/static/client/src/components/SignIn/signInForm.vue | 2 +- src/static/client/src/components/SignIn/totpForm.vue | 4 ++-- src/static/client/src/router/router.js | 2 +- src/static/client/src/utilities/request.js | 2 +- src/static/client/src/views/signup.vue | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client.py b/src/client.py index 6fb0e70..5f1fc66 100644 --- a/src/client.py +++ b/src/client.py @@ -79,7 +79,6 @@ def createClientBlueprint(wireguardConfigurations: dict[WireguardConfiguration], @client.get(prefix) def ClientIndex(): - print(wireguardConfigurations.keys()) return render_template('client.html') @client.get(f'{prefix}/api/validateAuthentication') diff --git a/src/static/client/src/components/SignIn/signInForm.vue b/src/static/client/src/components/SignIn/signInForm.vue index 94fa74d..02033ca 100644 --- a/src/static/client/src/components/SignIn/signInForm.vue +++ b/src/static/client/src/components/SignIn/signInForm.vue @@ -20,7 +20,7 @@ const signIn = async (e) => { return; } loading.value = true; - await axios.post(requestURl("/client/api/signin"), formData).then(res => { + await axios.post(requestURl("/api/signin"), formData).then(res => { let data = res.data; if (!data.status){ store.newNotification(data.message, "danger") diff --git a/src/static/client/src/components/SignIn/totpForm.vue b/src/static/client/src/components/SignIn/totpForm.vue index 6cbbcfe..6eae1a7 100644 --- a/src/static/client/src/components/SignIn/totpForm.vue +++ b/src/static/client/src/components/SignIn/totpForm.vue @@ -25,7 +25,7 @@ const formFilled = computed(() => { const store = clientStore() const router = useRouter() -await axios.get(requestURl('/client/api/signin/totp'), { +await axios.get(requestURl('/api/signin/totp'), { params: { Token: props.totpToken } @@ -53,7 +53,7 @@ const verify = async (e) => { e.preventDefault() if (formFilled){ loading.value = true - await axios.post(requestURl('/client/api/signin/totp'), { + await axios.post(requestURl('/api/signin/totp'), { Token: props.totpToken, UserProvidedTOTP: formData.TOTP }).then(res => { diff --git a/src/static/client/src/router/router.js b/src/static/client/src/router/router.js index 5deb677..bf4d6e6 100644 --- a/src/static/client/src/router/router.js +++ b/src/static/client/src/router/router.js @@ -32,7 +32,7 @@ const router = createRouter({ router.beforeEach(async (to, from, next) => { if (to.meta.auth){ - await axios.get(requestURl('/client/api/validateAuthentication')).then(res => { + await axios.get(requestURl('/api/validateAuthentication')).then(res => { next() }).catch(() => { const store = clientStore() diff --git a/src/static/client/src/utilities/request.js b/src/static/client/src/utilities/request.js index cb08302..4fc1d1d 100644 --- a/src/static/client/src/utilities/request.js +++ b/src/static/client/src/utilities/request.js @@ -1,5 +1,5 @@ export const requestURl = (url) => { - return import.meta.env.MODE === 'development' ? url + return import.meta.env.MODE === 'development' ? '/client' + url : `${window.location.protocol}//${(window.location.host + window.location.pathname + url).replace(/\/\//g, '/')}` } diff --git a/src/static/client/src/views/signup.vue b/src/static/client/src/views/signup.vue index e2e0f10..208ca9e 100644 --- a/src/static/client/src/views/signup.vue +++ b/src/static/client/src/views/signup.vue @@ -22,7 +22,7 @@ const signUp = async (e) => { } if (validatePassword){ loading.value = true - await axios.post(requestURl('/client/api/signup'), formData).then((res) => { + await axios.post(requestURl('/api/signup'), formData).then((res) => { let data = res.data if (!data.status){ store.newNotification(data.message, "danger")