создал homepage
This commit is contained in:
@@ -88,7 +88,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
redirectHomePage() {
|
redirectHomePage() {
|
||||||
this.$router.push("/calendar");
|
this.$router.push("/");
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
await fetchWrapper.post("auth/logout");
|
await fetchWrapper.post("auth/logout");
|
||||||
|
|||||||
29
src/pages/home/TheHome.vue
Normal file
29
src/pages/home/TheHome.vue
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
.wrapper.flex.flex-col.w-full.bg-white.p-4
|
||||||
|
.text-xxl.font-bold.pa-3
|
||||||
|
.text Добрый день, %username%!
|
||||||
|
.text.pt-3.cursor-pointer(@click="gotoCalendar") Расписание приемов
|
||||||
|
.text.pt-3.cursor-pointer(@click="gotoMedicalCards") Медицинские карты
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "TheHome",
|
||||||
|
methods: {
|
||||||
|
gotoCalendar() {
|
||||||
|
this.$router.push("/calendar");
|
||||||
|
},
|
||||||
|
gotoMedicalCards() {
|
||||||
|
this.$router.push("/medcards");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.wrapper
|
||||||
|
overflow: auto
|
||||||
|
border-top-left-radius: 4px
|
||||||
|
border-top-right-radius: 4px
|
||||||
|
</style>
|
||||||
@@ -6,6 +6,7 @@ import TheLogin from "@/pages/login/TheLogin";
|
|||||||
import LoggedInLayout from "@/components/LoggedInLayout";
|
import LoggedInLayout from "@/components/LoggedInLayout";
|
||||||
import TheMedicalCard from "@/pages/newMedicalCard/TheMedicalCard";
|
import TheMedicalCard from "@/pages/newMedicalCard/TheMedicalCard";
|
||||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||||
|
import TheHome from "@/pages/home/TheHome";
|
||||||
|
|
||||||
const ifNotAuthenticated = async (to, from, next) => {
|
const ifNotAuthenticated = async (to, from, next) => {
|
||||||
const data = await fetchWrapper.get("users/me");
|
const data = await fetchWrapper.get("users/me");
|
||||||
@@ -34,7 +35,8 @@ export default createRouter({
|
|||||||
beforeEnter: ifAuthenticated,
|
beforeEnter: ifAuthenticated,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
{ path: "", redirect: "calendar" },
|
{ path: "", redirect: "home" },
|
||||||
|
{ path: "home", component: TheHome },
|
||||||
{ path: "calendar", component: TheCalendar },
|
{ path: "calendar", component: TheCalendar },
|
||||||
{ path: "medcards", component: TheMedcards },
|
{ path: "medcards", component: TheMedcards },
|
||||||
{ path: "settings", component: TheSettings },
|
{ path: "settings", component: TheSettings },
|
||||||
|
|||||||
Reference in New Issue
Block a user