From 47f73d8cb12e7670e6dcaccea09c98e6ae4f00d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=96=89=EB=B3=B5=ED=95=9C=EC=97=84=EC=8C=A4?= Date: Tue, 4 Oct 2022 18:05:21 +0900 Subject: [PATCH 1/2] (10.4) 404 page created --- src/components/Error/NotFound.vue | 15 +++++++++++++++ src/router/index.js | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/components/Error/NotFound.vue diff --git a/src/components/Error/NotFound.vue b/src/components/Error/NotFound.vue new file mode 100644 index 0000000..c90937e --- /dev/null +++ b/src/components/Error/NotFound.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index b439309..d7970f1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -14,12 +14,18 @@ import MyPage from '@/components/MyPage/MyPage.vue' import Profile from '@/components/MyPage/Profile.vue' import MyPosts from '@/components/MyPage/MyPosts.vue' +import NotFound from '@/components/Error/NotFound.vue' + Vue.use(Router) export default new Router({ mode: 'history', routes: [ { path: '/', component: MainHome, name: 'home' }, + { + path: '/:pathMatch(.*)*', + redirect: '/404' + }, { path: '/topic', @@ -80,6 +86,12 @@ export default new Router({ { path: 'profile', component: Profile }, { path: 'posts', component: MyPosts } ] + }, + + { + path: '/404', + name: 'notFound', + component: NotFound } ] }) From c1d55d0523ef85f0a5edc21d9dbb52fafcb7f172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=96=89=EB=B3=B5=ED=95=9C=EC=97=84=EC=8C=A4?= Date: Wed, 5 Oct 2022 08:06:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?(10.5)=20=EC=98=A4=ED=83=80=20=EC=9D=BC?= =?UTF-8?q?=EB=B6=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/AxiosInstanceController.js | 2 +- src/api/modules/notifications.js | 0 src/assets/error/404.svg | 27 +++++++++ src/components/Error/NotFound.vue | 8 +-- src/components/MyPage/Notifications.vue | 76 +++++++++++++++++++++++++ src/router/index.js | 20 ++++--- 6 files changed, 118 insertions(+), 15 deletions(-) create mode 100644 src/api/modules/notifications.js create mode 100644 src/assets/error/404.svg create mode 100644 src/components/MyPage/Notifications.vue diff --git a/src/api/AxiosInstanceController.js b/src/api/AxiosInstanceController.js index 5767bd2..cd43dd9 100644 --- a/src/api/AxiosInstanceController.js +++ b/src/api/AxiosInstanceController.js @@ -35,7 +35,7 @@ function setInterceptors (instance) { accountsApi.refreshToken() } else { accountsApi.logout() - console.logt('토큰 만료, 재로그인 필요') + console.log('토큰 만료, 재로그인 필요') userStore.commit('dialogOpen', 'login') } } else if (error.response.status === 400) { diff --git a/src/api/modules/notifications.js b/src/api/modules/notifications.js new file mode 100644 index 0000000..e69de29 diff --git a/src/assets/error/404.svg b/src/assets/error/404.svg new file mode 100644 index 0000000..40bbbc8 --- /dev/null +++ b/src/assets/error/404.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/Error/NotFound.vue b/src/components/Error/NotFound.vue index c90937e..db1c0bb 100644 --- a/src/components/Error/NotFound.vue +++ b/src/components/Error/NotFound.vue @@ -1,6 +1,6 @@ @@ -9,7 +9,3 @@ export default { } - - \ No newline at end of file diff --git a/src/components/MyPage/Notifications.vue b/src/components/MyPage/Notifications.vue new file mode 100644 index 0000000..10c9faf --- /dev/null +++ b/src/components/MyPage/Notifications.vue @@ -0,0 +1,76 @@ + + diff --git a/src/router/index.js b/src/router/index.js index d7970f1..84baeeb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -13,6 +13,7 @@ import PitAPat from '@/components/PitAPat/PitAPat.vue' import MyPage from '@/components/MyPage/MyPage.vue' import Profile from '@/components/MyPage/Profile.vue' import MyPosts from '@/components/MyPage/MyPosts.vue' +import Notifications from '@/components/MyPage/Notifications.vue' import NotFound from '@/components/Error/NotFound.vue' @@ -22,11 +23,18 @@ export default new Router({ mode: 'history', routes: [ { path: '/', component: MainHome, name: 'home' }, + { - path: '/:pathMatch(.*)*', + path: '*', redirect: '/404' }, + { + path: '/404', + name: 'notFound', + component: NotFound + }, + { path: '/topic', component: Topic, @@ -84,14 +92,10 @@ export default new Router({ props: true, children: [ { path: 'profile', component: Profile }, - { path: 'posts', component: MyPosts } + { path: 'posts', component: MyPosts }, + { path: 'notifications', component: Notifications } ] - }, - - { - path: '/404', - name: 'notFound', - component: NotFound } + ] })