From ebd42df504a7b28b195c053fc52d49633b75bb06 Mon Sep 17 00:00:00 2001 From: minseokkang Date: Fri, 18 Nov 2022 15:35:06 +0900 Subject: [PATCH] feat: [FE] Profile and Settings connection, Implement Unfollow, follow API, getProfile. --- src/vite-frontend/src/router/index.ts | 3 +- src/vite-frontend/src/store/index.ts | 5 +- src/vite-frontend/src/views/TheProfile.vue | 110 ++++++++++++++++++--- src/vite-frontend/src/views/TheSetting.vue | 10 +- 4 files changed, 110 insertions(+), 18 deletions(-) diff --git a/src/vite-frontend/src/router/index.ts b/src/vite-frontend/src/router/index.ts index ae26b96..829e75a 100644 --- a/src/vite-frontend/src/router/index.ts +++ b/src/vite-frontend/src/router/index.ts @@ -30,7 +30,8 @@ const routes = [ { path: "/@:username", name: "Profile", - component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheProfile.vue') + component: () => import(/* webpackChunkName "inputTag" */ '@/views/TheProfile.vue'), + props: true } ]; diff --git a/src/vite-frontend/src/store/index.ts b/src/vite-frontend/src/store/index.ts index ce75105..29062b9 100644 --- a/src/vite-frontend/src/store/index.ts +++ b/src/vite-frontend/src/store/index.ts @@ -13,6 +13,9 @@ export default createStore({ setToken(state, token){ state.token = token; }, + getToken(state){ + return state.token + } }, actions: { LOGIN({commit}, user){ @@ -20,7 +23,7 @@ export default createStore({ commit("setToken", user.token); localStorage.setItem("username", user.username); localStorage.setItem("token", user.token); - } + }, }, } ) diff --git a/src/vite-frontend/src/views/TheProfile.vue b/src/vite-frontend/src/views/TheProfile.vue index cafd739..565caee 100644 --- a/src/vite-frontend/src/views/TheProfile.vue +++ b/src/vite-frontend/src/views/TheProfile.vue @@ -7,16 +7,29 @@
- -

Eric Simons

+ +

{{ profile.username }}

- Cofounder @GoThinkster, lived in Aol's HQ for a few months, kinda looks like Peeta from the - Hunger Games + {{ profile.bio }}

-
@@ -89,9 +102,84 @@