diff --git a/src/auth/index.js b/src/auth/index.js index f4ab903..1427ea7 100644 --- a/src/auth/index.js +++ b/src/auth/index.js @@ -124,14 +124,18 @@ export const useAuth0 = ({ verified: true // profileImage: u.picture }).then(res => { - console.log("res", res); + console.log("res---profile", res); this.$toaster.success(res.data.message); - localStorage.setItem('spotlight_usertoken', JSON.stringify(res.data.data)) + localStorage.setItem('spotlight_usertoken', JSON.stringify(res.data.data)); + localStorage.setItem('spotlight_id', res.data.data.id); var previousUrl = localStorage.getItem("previous_url_spotlight"); console.log("onboarding", previousUrl) if (!previousUrl) { - router.push({ name: 'Profile' }); + router.push({ name: 'Profile', + params: { + id: res.data.data.id, + }, }); } else { previousUrl = JSON.parse(previousUrl); console.log("onboarding-2", previousUrl) diff --git a/src/components/AuthorIntro.vue b/src/components/AuthorIntro.vue index 5360ef3..cdaa618 100644 --- a/src/components/AuthorIntro.vue +++ b/src/components/AuthorIntro.vue @@ -78,13 +78,16 @@ export default { allSlide:[], currentSlideIndex:null, currentSlideData:null, + // + userId:null, }; }, mounted() { var allSlideData = localStorage.getItem("spotlight_slide"+this.$route.params.caseStudyId); if (allSlideData) { this.allSlide = JSON.parse(allSlideData); - this.getCurrentSlideData(); + // this.getCurrentSlideData(); + this.generatecaseStudies(); }else{ this.generatecaseStudies(); } @@ -110,6 +113,7 @@ export default { openStudy(payload) { console.log("payload-", payload); + this.userId = payload.userId[0]; payload.intro.date = payload.createdAt; payload.intro.focusPoint = payload.focusAreas; axios @@ -259,7 +263,12 @@ export default { this.$router.push("/"); }, goToProfile() { - this.$router.push("/profile"); + this.$router.push({ + name: "Profile", + params: { + id: this.userId, + }, + }); }, }, diff --git a/src/components/Header.vue b/src/components/Header.vue index 61726f2..bda1904 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -73,12 +73,12 @@ export default { return { usertoken: null, profilePictue: null, + userId: null, }; }, mounted() { - - var userdata = localStorage.getItem("spotlight_usertoken"); + this.userId = localStorage.getItem("spotlight_id"); if (userdata) { userdata = JSON.parse(userdata); this.usertoken = userdata.token; @@ -87,11 +87,17 @@ export default { }, methods: { goTo() { - this.$router.push("/profile"); + this.$router.push({ + name: "Profile", + params: { + id: this.userId, + }, + }); }, goToLogin() { localStorage.removeItem("spotlight_usertoken"); localStorage.removeItem("spotlight_email"); + localStorage.removeItem("spotlight_id"); this.$router.push("/login"); }, getProfile() { diff --git a/src/components/Intermediate.vue b/src/components/Intermediate.vue index 4b2b65e..72d78a2 100644 --- a/src/components/Intermediate.vue +++ b/src/components/Intermediate.vue @@ -11,8 +11,12 @@ name: 'Intermediate', data() { var userdata = localStorage.getItem('spotlight_usertoken') + var userid = localStorage.getItem('spotlight_id') if(userdata){ - router.push({ path: '/profile'}) + router.push({ name: 'Profile', + params: { + id: userid, + }, }); } return { msg: 'Welcome to Your Vue.js App' diff --git a/src/components/LandingPage.vue b/src/components/LandingPage.vue index fccc6e8..5b0fef0 100644 --- a/src/components/LandingPage.vue +++ b/src/components/LandingPage.vue @@ -42,13 +42,10 @@ -
@@ -618,8 +632,12 @@
- {{comments.comment}} + {{ comments.comment }}