Blame view
src/components/LandingPage.vue
6.29 KB
8a0dd59d9
|
1 2 3 4 |
<template> <main class="landing-page"> <div class="container-fluid main-wrp"> <nav class="navbar navbar-expand-sm spotLight-nav"> |
56f4b7548
|
5 |
<a class="navbar-brand" href="javascript:void(0);" |
8a0dd59d9
|
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
><img src="../assets/images/logo.png" /></a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExample03" aria-controls="navbarsExample03" aria-expanded="false" aria-label="Toggle navigation" > <span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarsExample03"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> |
56f4b7548
|
25 |
<a class="nav-link" href="javascript:void(0);">About</a> |
8a0dd59d9
|
26 27 |
</li> <li class="nav-item"> |
56f4b7548
|
28 |
<a class="nav-link" href="javascript:void(0);">Masterclass</a> |
8a0dd59d9
|
29 30 |
</li> <li class="nav-item"> |
56f4b7548
|
31 |
<a class="nav-link" href="javascript:void(0);">Stories</a> |
8a0dd59d9
|
32 33 |
</li> <li class="nav-item spotLight-img"> |
56f4b7548
|
34 |
<a class="nav-link" href="javascript:void(0);" |
8a0dd59d9
|
35 36 37 38 |
><img src="../assets/images/SPOTLight.svg" /></a> </li> <li class="nav-item"> |
56f4b7548
|
39 |
<a class="nav-link" href="javascript:void(0);">Library</a> |
8a0dd59d9
|
40 41 42 43 44 |
</li> </ul> </div> </nav> <!-- menu wrapper --> |
2991bacc1
|
45 |
<div class="sign-login-wrp"> |
8a0dd59d9
|
46 |
<!-- users land image --> |
f2328546d
|
47 |
<div class="s-l-left-section"> |
2991bacc1
|
48 |
<h1 class="welcome-hd-back">we’re stoked you’re back!</h1> |
8a0dd59d9
|
49 50 |
</div> <!-- users land image --> |
f2328546d
|
51 52 |
<div class="s-l-right-section"> <div class="form-layout"> |
56f4b7548
|
53 54 |
<form v-on:keyup.enter="loginWIthEmail"> <h5>Log In using</h5> |
8a0dd59d9
|
55 56 57 |
<div class="social-login"> <ul> <li> |
2991bacc1
|
58 59 60 |
<a @click="login" class="cursor-pointer" ><img src="../assets/images/google.svg" /></a> |
8a0dd59d9
|
61 62 |
</li> <li> |
2991bacc1
|
63 64 65 |
<a @click="login" class="cursor-pointer" ><img src="../assets/images/linkdin.svg" /></a> |
8a0dd59d9
|
66 67 |
</li> <li> |
2991bacc1
|
68 69 70 |
<a @click="login" class="cursor-pointer" ><img src="../assets/images/twitter.svg" /></a> |
8a0dd59d9
|
71 72 73 |
</li> </ul> </div> |
56f4b7548
|
74 |
<h5>or Log In with email</h5> |
8a0dd59d9
|
75 76 77 78 79 80 81 |
<div class="fill-form"> <label for="inputEmail" class="sr-only">Email address</label> <input type="email" id="inputEmail" class="form-control" placeholder="Your Email ID" |
5684145ce
|
82 |
v-model="userData.email" |
8a0dd59d9
|
83 84 85 86 87 88 89 |
/> <label for="inputPassword" class="sr-only">Password</label> <input type="password" id="inputPassword" class="form-control" placeholder="Password" |
5684145ce
|
90 |
v-model="userData.password" |
8a0dd59d9
|
91 |
/> |
2991bacc1
|
92 93 94 95 96 97 |
<a href="javascript:void(0);" class="btn btn-lg sb-button" type="submit" @click="loginWIthEmail" > |
8a0dd59d9
|
98 |
<img src="../assets/images/key.svg" /> Log In to your account |
5684145ce
|
99 |
</a> |
d974d3228
|
100 |
<p class="forget-pass light-font-weight"> |
2991bacc1
|
101 102 103 104 |
Forgot Password? <a class="cursor-pointer light-font-weight" @click="goToReset" >Reset</a > |
8a0dd59d9
|
105 |
</p> |
2991bacc1
|
106 107 108 109 110 111 |
<h3 class="ft-normal"> Don’t have an account? <a class="cursor-pointer no-underline" @click="goToSignUp" >SignUp</a > </h3> |
8a0dd59d9
|
112 113 114 115 116 |
</div> </form> </div> </div> <!-- sign up --> |
2991bacc1
|
117 |
</div> |
8a0dd59d9
|
118 119 120 121 122 123 |
<!-- body wrapper --> </div> </main> </template> <script> |
8a0dd59d9
|
124 125 126 |
import Vue from "vue"; import router from "../router"; import $ from "jquery"; |
5684145ce
|
127 |
import axios from "axios"; |
8a0dd59d9
|
128 129 130 131 132 133 134 |
export default { name: "LandingPage", data() { return { loggedinFlag: false, |
2991bacc1
|
135 |
userData: {}, |
8a0dd59d9
|
136 137 |
}; }, |
2991bacc1
|
138 |
mounted() { |
9e1d93fad
|
139 |
// this.$auth.logout(); |
f2328546d
|
140 141 142 |
// localStorage.removeItem("spotlight_usertoken"); // localStorage.removeItem("spotlight_email"); var userdata = localStorage.getItem("spotlight_usertoken"); |
2991bacc1
|
143 |
var userid = localStorage.getItem("spotlight_id"); |
f2328546d
|
144 |
if (userdata) { |
2991bacc1
|
145 146 147 148 149 150 151 |
// this.$router.push("/profile"); this.$router.push({ name: "Profile", params: { id: userid, }, }); |
f2328546d
|
152 |
} |
298fff252
|
153 |
}, |
8a0dd59d9
|
154 |
methods: { |
2991bacc1
|
155 |
login() { |
298fff252
|
156 157 |
this.$auth.loginWithRedirect(); }, |
2991bacc1
|
158 |
goToSignUp() { |
56f4b7548
|
159 |
this.$router.push("/"); |
988b5d20a
|
160 161 162 163 |
}, goToReset() { this.$router.push("/reset"); }, |
2991bacc1
|
164 165 |
loginWIthEmail() { axios |
5684145ce
|
166 167 |
.post("/login", this.userData) .then((response) => { |
2991bacc1
|
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
console.log("login- response", response); this.$toaster.success(response.data.message); if (response.data.status == "success") { localStorage.setItem( "spotlight_usertoken", JSON.stringify(response.data.data) ); localStorage.setItem("spotlight_id", res.data.data.id); this.$router.push({ name: "Profile", params: { id: res.data.data.id, }, }); } |
5684145ce
|
183 |
}) |
2991bacc1
|
184 |
.catch((error) => { |
5684145ce
|
185 |
if (error.response) { |
2991bacc1
|
186 187 188 189 |
this.$toaster.error(error.response.data.message); if (error.response.data.message == "Email Not Verified") { localStorage.setItem("spotlight_email", this.userData.email); this.$router.push({ name: "Otp", params: { flag: true } }); |
5684145ce
|
190 191 192 |
} } }); |
2991bacc1
|
193 |
}, |
8a0dd59d9
|
194 195 196 |
}, }; </script> |
d974d3228
|
197 198 |
<style> .light-font-weight { |
56f4b7548
|
199 200 |
font-weight: 500 !important; } |
2991bacc1
|
201 |
.no-underline { |
56f4b7548
|
202 |
text-decoration: none; |
d974d3228
|
203 |
} |
d974d3228
|
204 |
</style> |