Commit caaa85a2cd4719d4ede9b293b88bab51d96afae7

Authored by Shikha Mishra
1 parent 819c223ec0

set api's of forget password and reset password

Showing 1 changed file with 58 additions and 64 deletions   Show diff stats
src/pages/Authentication/forgetpassword.vue
1 1 <template>
2 2 <v-app id="login">
3   - <v-toolbar class="fixcolors">
4   - <v-toolbar-items>
5   - <img src="/static/logoIntrack.png" height="40" width="140" alt="logo">
  3 + <v-toolbar dense flat class="transparent mb-4">
  4 + <v-toolbar-items class="mx-auto">
  5 + <img src="/static/icon.png" height="50" width="140" alt="logo" style=" margin-top: 15%">
6 6 </v-toolbar-items>
7 7 </v-toolbar>
8 8 <v-container fluid>
9 9 <v-layout align-center justify-center fill-height>
10   - <v-flex xs12 sm8 md7 lg8>
  10 + <v-flex xs12 sm10 md6 lg4>
11 11 <div>
12 12 <v-app>
13 13 <v-stepper v-model="e2">
... ... @@ -21,8 +21,8 @@
21 21 <v-content>
22 22 <v-container fluid class="content">
23 23 <v-layout align-center justify-center fill-height>
24   - <v-flex xs12 sm8 md7 lg8>
25   - <v-toolbar class="fixcolors" dark>
  24 + <v-flex>
  25 + <v-toolbar style="background-color: #7852cc" dark>
26 26 <v-spacer></v-spacer>
27 27 <v-toolbar-title>Forget Password</v-toolbar-title>
28 28 <v-spacer></v-spacer>
... ... @@ -46,20 +46,17 @@
46 46 </v-card-text>
47 47 <v-card-actions>
48 48 <v-flex text-xs-center>
49   - <v-btn round class="mt-1 button fixcolors" dark large @click="reset">Send Request</v-btn>
  49 + <v-btn style="background-color: #71d9ea; color: #0c0754;" dark flat @click="reset">Send Request</v-btn>
50 50 </v-flex>
51 51 </v-card-actions>
52 52 <v-snackbar
53   - :timeout="timeout"
54   - :top="y === 'top'"
55   - :right="x === 'right'"
56   - :vertical="mode === 'vertical'"
57   - v-model="snackbar"
58   - :color= color
59   - >
60   - {{ text }}
61   - </v-snackbar>
62   - </v-snackbar>
  53 + :timeout="timeout"
  54 + :top="y === 'top'"
  55 + :right="x === 'right'"
  56 + :vertical="mode === 'vertical'"
  57 + v-model="snackbar"
  58 + :color= color
  59 + >{{ text }}</v-snackbar>
63 60 </v-card>
64 61 </v-flex>
65 62 </v-layout>
... ... @@ -70,8 +67,8 @@
70 67 <v-content>
71 68 <v-container fluid fill-height>
72 69 <v-layout align-center justify-center>
73   - <v-flex xs12 sm8 md7 lg8>
74   - <v-toolbar class="fixcolors" dark>
  70 + <v-flex>
  71 + <v-toolbar style="background-color: #7852cc" dark>
75 72 <v-spacer></v-spacer>
76 73 <v-toolbar-title>Forget Password</v-toolbar-title>
77 74 <v-spacer></v-spacer>
... ... @@ -84,11 +81,12 @@
84 81 <v-form class="mt-4">
85 82 <div class="custom-input-align">
86 83 <v-text-field
87   - class="text-md-center"
88   - v-model="email"
89   - :rules="emailRules"
90   - label="Enter Your email ID"
91   - required></v-text-field>
  84 + class="text-md-center"
  85 + v-model="uniqueCode"
  86 + type="text"
  87 + label="Enter Unique Code"
  88 + required>
  89 + </v-text-field>
92 90 <v-text-field
93 91 :rules="[rules.required,rules.min]"
94 92 v-model="changepassword"
... ... @@ -96,7 +94,7 @@
96 94 :append-icon-cb="() => (e1 = !e1)"
97 95 :type="e1 ? 'password' : 'text'"
98 96 name="input-10-1"
99   - label="Password"
  97 + label="New Password"
100 98 counter
101 99 ></v-text-field>
102 100 </div>
... ... @@ -105,42 +103,37 @@
105 103 </v-card-text>
106 104 <v-card-actions>
107 105 <v-flex text-xs-center>
108   - <v-btn round class="mt-1 button fixcolors" dark large @click="resetPassword">Send Request</v-btn>
  106 + <v-btn style="background-color: #71d9ea; color: #0c0754;" dark flat @click="resetPassword">Send Request</v-btn>
109 107 </v-flex>
110 108 </v-card-actions>
111 109 <v-snackbar
112   - :timeout="timeout"
113   - :top="y === 'top'"
114   - :right="x === 'right'"
115   - :vertical="mode === 'vertical'"
116   - v-model="snackbar"
117   - :color= color
118   - >
119   - {{ text }}
120   - </v-snackbar>
121   - </v-snackbar>
122   - </v-card>
123   - </v-flex>
124   - </v-layout>
125   - </v-container>
126   - </v-content>
127   - <v-btn
128   - color="primary"
129   - dark
130   - @click="e2 = 1"
131   - >
132   - Back
133   - </v-btn>
134   - </v-stepper-content>
135   - </v-stepper-items>
136   - </v-stepper>
137   - </v-app>
138   - </div>
  110 + :timeout="timeout"
  111 + :top="y === 'top'"
  112 + :right="x === 'right'"
  113 + :vertical="mode === 'vertical'"
  114 + v-model="snackbar"
  115 + :color= color
  116 + >{{ text }}</v-snackbar>
  117 + </v-card>
  118 + </v-flex>
  119 + </v-layout>
  120 + </v-container>
  121 + </v-content>
  122 + <v-btn
  123 + color="#7852cc"
  124 + dark
  125 + @click="e2 = 1"
  126 + >Back</v-btn>
  127 + </v-stepper-content>
  128 + </v-stepper-items>
  129 + </v-stepper>
  130 + </v-app>
  131 + </div>
139 132 </v-flex>
140   - </v-layout>
141   - </v-container>
142   - <v-footer class="pa-4 fixcolors">
143   - </v-footer>
  133 + </v-layout>
  134 + </v-container>
  135 + <!-- <v-footer class="pa-4 fixcolors">
  136 + </v-footer> -->
144 137 </v-app>
145 138 </template>
146 139  
... ... @@ -160,8 +153,8 @@ export default {
160 153 timeout: 4000,
161 154 text: '',
162 155 loading: false,
163   - email: '',
164 156 forgetemail:'',
  157 + uniqueCode: '',
165 158 password:'',
166 159 changepassword:'',
167 160 valid: true,
... ... @@ -171,6 +164,7 @@ export default {
171 164 /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) ||
172 165 "E-mail must be valid"
173 166 ],
  167 +
174 168 rules: {
175 169 required: value => !!value || "password is Required.",
176 170 min: v =>
... ... @@ -185,14 +179,14 @@ export default {
185 179 methods: {
186 180 reset () {
187 181 if (this.$refs.form.validate()) {
188   - http().get('/schoolForgotPassword?email='+ this.forgetemail)
  182 + http().get('/forgot-password?email='+ this.forgetemail)
189 183 .then(response => {
190 184 // console.log("response=====>",response.data.data.token);
191 185 this.$store.dispatch("setToken", response.data.data.token);
192 186 this.loading = true;
193 187 this.e2 = 2 ;
194 188 if(this.snackbar=true){
195   - this.text= "Please you Fill Last Step of Forget Password!"
  189 + this.text= "Please Fill your Last Step of Forget Password!"
196 190 }
197 191 }).catch(err => {
198 192 this.text="User Not Found or Incorrect Email"
... ... @@ -203,11 +197,11 @@ export default {
203 197 },
204 198 resetPassword(){
205 199 let forgotPassword = {
206   - resetToken: this.$store.state.token,
207   - email: this.email,
  200 + email: this.forgetemail,
  201 + uniqueCode: this.uniqueCode,
208 202 password: this.changepassword
209 203 }
210   - http().post('/schoolResetPassword',forgotPassword)
  204 + http().post('/reset-password',forgotPassword)
211 205 .then(response => {
212 206 console.log("response=====>",response);
213 207 this.loading = true;
... ... @@ -246,7 +240,7 @@ export default {
246 240 z-index: 0;
247 241 }
248 242 img{
249   - position:absolute;
  243 + /* position:absolute; */
250 244 top:13px;
251 245 left:8px;
252 246 }
... ...