Use Vue-based login page

This commit is contained in:
2022-05-05 14:39:41 +02:00
parent 825f9fcd50
commit 64196eeab2
8 changed files with 80 additions and 77 deletions

View File

@ -1,5 +1,6 @@
import { computed } from "@vue/reactivity";
import { ref, watch } from "vue";
import router from "./router";
export const substitutionFilter = ref(
localStorage.getItem("substitutionFilter") || "all"
@ -62,6 +63,10 @@ export const parsedTimetable = computed(() => {
export async function fetchData() {
const baseUrl = "/api";
const checkResponse = await fetch(`${baseUrl}/check`);
if (checkResponse.status != 200) router.push("/login");
const timetableResponse = await fetch(
`${baseUrl}/timetable?class=${timetableClass.value}`
);