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/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/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 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') }