From 034a6bc4cceee3f754a782bf2a651ba65613a574 Mon Sep 17 00:00:00 2001 From: Liam Cabra Teixeira Date: Thu, 1 Oct 2020 20:10:56 -0300 Subject: [PATCH 1/2] fix login --- src/store/modules/ProfileVuex.js | 2 +- src/views/public/Login.vue | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/store/modules/ProfileVuex.js b/src/store/modules/ProfileVuex.js index de6f9f2..fb40818 100644 --- a/src/store/modules/ProfileVuex.js +++ b/src/store/modules/ProfileVuex.js @@ -22,7 +22,7 @@ export default { async getUser(context){ const token = localStorage.getItem('token'); const decodedToken = await axios.post(process.env.VUE_APP_BASE_URL+'/user/authToken', token); - + console.log(decodedToken) const user = await axios.get(process.env.VUE_APP_BASE_URL+`/user/mail/${decodedToken.data}`); return user.data; diff --git a/src/views/public/Login.vue b/src/views/public/Login.vue index c3359c2..5dbdc6a 100644 --- a/src/views/public/Login.vue +++ b/src/views/public/Login.vue @@ -71,7 +71,11 @@ export default { position: "topCenter" }) - localStorage.token = isAuth.data + // localStorage.token = isAuth.data[0] + + const token = isAuth.data[0]; + + localStorage.token = isAuth.data[0]; this.$router.push('/Feed') } From c9f7171f0ebac57b0c51d0cc6b0b46b027598fef Mon Sep 17 00:00:00 2001 From: Pedro Lopes Date: Thu, 1 Oct 2020 20:51:03 -0300 Subject: [PATCH 2/2] starting coment screen --- src/components/EventCard/EventCard.vue | 78 ++++++++++++++++++++++++++ src/components/cpmCard.vue | 2 +- src/router/index.js | 5 ++ src/store/modules/EventVuex.js | 21 +++++++ src/views/private/Coment.vue | 22 ++++++++ 5 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 src/components/EventCard/EventCard.vue create mode 100644 src/views/private/Coment.vue diff --git a/src/components/EventCard/EventCard.vue b/src/components/EventCard/EventCard.vue new file mode 100644 index 0000000..d69380a --- /dev/null +++ b/src/components/EventCard/EventCard.vue @@ -0,0 +1,78 @@ + + + \ No newline at end of file diff --git a/src/components/cpmCard.vue b/src/components/cpmCard.vue index e31a1c4..ebb1753 100644 --- a/src/components/cpmCard.vue +++ b/src/components/cpmCard.vue @@ -6,7 +6,7 @@ - mdi-account-circle + mdi-account-circle avatar diff --git a/src/router/index.js b/src/router/index.js index 949ee82..387f83e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -51,6 +51,11 @@ const routes = [ path: '/Profile', name: 'Profile', component: () => import('../views/private/Profile.vue') + }, + { + path: '/Coment/1', + name: 'Coment', + component: () => import('../views/private/Coment.vue') } ] diff --git a/src/store/modules/EventVuex.js b/src/store/modules/EventVuex.js index 6220f1c..c197881 100644 --- a/src/store/modules/EventVuex.js +++ b/src/store/modules/EventVuex.js @@ -1,17 +1,38 @@ +import axios from '../../util/axios' + + export default { namespaced: true, state: { + eventDataId:'' }, getters: { + eventDataId: state=> state.eventDataId }, mutations: { + setEventDataId(state, newState){ + state.eventDataId = newState + } }, actions: { + async getEventById(context, newData){ + + const eventResult = await axios.get(process.env.VUE_APP_BASE_URL + `/event/${newData}`) + try { + context.commit('setEventDataId', eventResult.data) + return eventResult.data + } + + catch{ + console.log(eventResult) + } + + } } } diff --git a/src/views/private/Coment.vue b/src/views/private/Coment.vue new file mode 100644 index 0000000..b70b0b6 --- /dev/null +++ b/src/views/private/Coment.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file