Commit f0281dd43ca369fd5213ec2c5fe06a16eb97cc69

Authored by Neeraj Sharma
1 parent e3e2a04c61

add run api of retlated students,forget&change password and related teacher api

src/pages/Dashboard.vue
... ... @@ -71,17 +71,17 @@
71 71 <v-spacer></v-spacer>
72 72 </v-toolbar>
73 73 <v-card>
74   - <v-flex align-center justify-center layout text-xs-center>
  74 + <!-- <v-flex align-center justify-center layout text-xs-center>
75 75 <v-avatar size="50px" style="position:absolute; top:10px; ">
76 76 <img src="/static/icon/user.png">
77 77 </v-avatar>
78   - </v-flex>
  78 + </v-flex> -->
79 79 <v-card-text>
80 80 <v-container>
81 81 <v-layout wrap justify-center>
82 82 <v-flex xs12 sm9>
83 83 <v-form ref="form" v-model="valid" lazy-validation>
84   - <v-layout style="position:relative; top:15px;">
  84 + <v-layout style="position:relative;">
85 85 <v-flex xs4 class="pt-4 subheading">
86 86 <label>Full Name:</label>
87 87 </v-flex>
... ...
src/pages/Login.vue
... ... @@ -99,7 +99,7 @@ export default {
99 99 // (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/.test(
100 100 // v
101 101 // ) &&
102   - // v.length >= 4) ||
  102 + // v.length >= 6) ||
103 103 // "Min 4 characters upper case lower case symbol required"
104 104 }
105 105 };
... ...
src/pages/Students.vue
... ... @@ -71,17 +71,17 @@
71 71 <v-spacer></v-spacer>
72 72 </v-toolbar>
73 73 <v-card>
74   - <v-flex align-center justify-center layout text-xs-center>
  74 + <!-- <v-flex align-center justify-center layout text-xs-center>
75 75 <v-avatar size="50px" style="position:absolute; top:10px; ">
76 76 <img src="/static/icon/user.png">
77 77 </v-avatar>
78   - </v-flex>
  78 + </v-flex> -->
79 79 <v-card-text>
80 80 <v-container>
81 81 <v-layout wrap justify-center>
82 82 <v-flex xs12 sm9>
83 83 <v-form ref="form" v-model="valid" lazy-validation>
84   - <v-layout style="position:relative; top:15px;">
  84 + <v-layout style="position:relative;">
85 85 <v-flex xs4 class="pt-4 subheading">
86 86 <label>Full Name:</label>
87 87 </v-flex>
... ...
src/pages/forgetpassword.vue
... ... @@ -2,68 +2,158 @@
2 2 <v-app id="login">
3 3 <v-toolbar color="grey lighten">
4 4 <v-toolbar-items>
5   - <!-- <img src="/static/ana@2x.png" height="36" alt="ana" /> -->
6   - <h3 class="white--text my-3 ml-4">School-Management</h3>
7   - </v-toolbar-items>
8   - </v-toolbar>
9   - <v-content>
10   - <v-container fluid fill-height>
11   - <v-layout align-center justify-center>
12   - <v-flex xs12 sm8 md7 lg5>
13   - <v-toolbar color="black" dark>
14   - <v-spacer></v-spacer>
15   - <v-toolbar-title>Forget Password</v-toolbar-title>
16   - <v-spacer></v-spacer>
17   - </v-toolbar>
18   - <v-card class="elevation-1 pa-1">
19   - <v-card-text>
20   - <h5 class="text-xs-center"> Not to Worry! Enter to your registered Email ID. </h5>
21   - <h5 class="text-xs-center"> We'll send you a reset.</h5>
22   - <v-flex lg4 sm6 xs10 offset-sm3 offset-xs1 offset-lg4>
23   - <v-form class="mt-4">
24   - <div class="custom-input-align">
25   - <v-text-field
26   - class="text-md-center"
27   - v-validate="'required|email'"
28   - v-model="changePassword"
29   - :error-messages="errors.collect('email')"
30   - label="Enter Your email ID"
31   - data-vv-name="email"
32   - required>
33   - </v-text-field>
34   - </div>
35   - </v-form></v-flex>
36   - </v-card-text>
37   - <v-card-actions>
38   - <v-flex text-xs-center>
39   - <v-btn round class="mt-1 button" color="black" dark large @click="reset">Send Request</v-btn></v-flex>
40   - </v-card-actions>
41   - <v-snackbar
42   - :timeout="timeout"
43   - :top="y === 'top'"
44   - :right="x === 'right'"
45   - :vertical="mode === 'vertical'"
46   - v-model="snackbar"
47   - :color= color
48   - >
49   - {{ text }}
50   - </v-snackbar>
51   - </v-snackbar>
52   - </v-card>
53   - </v-flex>
54   - </v-layout>
55   - </v-container>
56   - </v-content>
57   - <v-footer class="pa-4" color="grey darken-2">
  5 + <!-- <img src="/static/ana@2x.png" height="36" alt="ana" /> -->
  6 + <h3 class="white--text my-3 ml-4">School-Management</h3>
  7 + </v-toolbar-items>
  8 + </v-toolbar>
  9 + <v-container fluid>
  10 + <v-layout align-center justify-center fill-height>
  11 + <v-flex xs12 sm8 md7 lg8>
  12 + <div>
  13 + <v-app>
  14 + <v-stepper v-model="e2">
  15 + <v-stepper-header>
  16 + <v-stepper-step :complete="e2 > 1" step="1">Fill Your Email</v-stepper-step>
  17 + <v-divider></v-divider>
  18 + <v-stepper-step step="2">Last Step of Forget Password</v-stepper-step>
  19 + </v-stepper-header>
  20 + <v-stepper-items>
  21 + <v-stepper-content step="1">
  22 + <v-content>
  23 + <v-container fluid>
  24 + <v-layout align-center justify-center fill-height>
  25 + <v-flex xs12 sm8 md7 lg10>
  26 + <v-toolbar color="black" dark>
  27 + <v-spacer></v-spacer>
  28 + <v-toolbar-title>Forget Password</v-toolbar-title>
  29 + <v-spacer></v-spacer>
  30 + </v-toolbar>
  31 + <v-card class="elevation-1 pa-1">
  32 + <v-card-text>
  33 + <h5 class="text-xs-center"> Not to Worry! Enter to your registered Email ID. </h5>
  34 + <h5 class="text-xs-center"> We'll send you a reset.</h5>
  35 + <v-flex lg4 sm6 xs10 offset-sm3 offset-xs1 offset-lg4>
  36 + <v-form class="mt-4">
  37 + <div class="custom-input-align">
  38 + <v-text-field
  39 + class="text-md-center"
  40 + :rules="emailRules"
  41 + v-model="forgetemail"
  42 + label="Enter Your email ID"
  43 + required></v-text-field>
  44 + </div>
  45 + </v-form>
  46 + </v-flex>
  47 + </v-card-text>
  48 + <v-card-actions>
  49 + <v-flex text-xs-center>
  50 + <v-btn round class="mt-1 button" color="black" dark large @click="reset, e2 = 2">Send Request</v-btn>
  51 + </v-flex>
  52 + </v-card-actions>
  53 + <v-snackbar
  54 + :timeout="timeout"
  55 + :top="y === 'top'"
  56 + :right="x === 'right'"
  57 + :vertical="mode === 'vertical'"
  58 + v-model="snackbar"
  59 + :color= color
  60 + >
  61 + {{ text }}
  62 + </v-snackbar>
  63 + </v-snackbar>
  64 + </v-card>
  65 + </v-flex>
  66 + </v-layout>
  67 + </v-container>
  68 + </v-content>
  69 + </v-stepper-content>
  70 + <v-stepper-content step="2">
  71 + <v-content>
  72 + <v-container fluid fill-height>
  73 + <v-layout align-center justify-center>
  74 + <v-flex xs12 sm8 md7 lg10>
  75 + <v-toolbar color="black" dark>
  76 + <v-spacer></v-spacer>
  77 + <v-toolbar-title>Forget Password</v-toolbar-title>
  78 + <v-spacer></v-spacer>
  79 + </v-toolbar>
  80 + <v-card class="elevation-1 pa-1">
  81 + <v-card-text>
  82 + <h5 class="text-xs-center"> Not to Worry! Enter to your registered Email ID And New Password. </h5>
  83 + <h5 class="text-xs-center"> We'll send you a reset.</h5>
  84 + <v-flex lg4 sm6 xs10 offset-sm3 offset-xs1 offset-lg4>
  85 + <v-form class="mt-4">
  86 + <div class="custom-input-align">
  87 + <v-text-field
  88 + class="text-md-center"
  89 + v-model="email"
  90 + :rules="emailRules"
  91 + label="Enter Your email ID"
  92 + required></v-text-field>
  93 + <v-text-field
  94 + :rules="[rules.required,rules.min]"
  95 + v-model="changepassword"
  96 + :append-icon="e1 ? 'visibility_off' : 'visibility'"
  97 + :append-icon-cb="() => (e1 = !e1)"
  98 + :type="e1 ? 'password' : 'text'"
  99 + name="input-10-1"
  100 + label="Password"
  101 + counter
  102 + ></v-text-field>
  103 + </div>
  104 + </v-form>
  105 + </v-flex>
  106 + </v-card-text>
  107 + <v-card-actions>
  108 + <v-flex text-xs-center>
  109 + <v-btn round class="mt-1 button" color="black" dark large @click="resetPassword">Send Request</v-btn>
  110 + </v-flex>
  111 + </v-card-actions>
  112 + <v-snackbar
  113 + :timeout="timeout"
  114 + :top="y === 'top'"
  115 + :right="x === 'right'"
  116 + :vertical="mode === 'vertical'"
  117 + v-model="snackbar"
  118 + :color= color
  119 + >
  120 + {{ text }}
  121 + </v-snackbar>
  122 + </v-snackbar>
  123 + </v-card>
  124 + </v-flex>
  125 + </v-layout>
  126 + </v-container>
  127 + </v-content>
  128 + <v-btn
  129 + color="black"
  130 + dark
  131 + @click="e2 = 1"
  132 + >
  133 + Back
  134 + </v-btn>
  135 + </v-stepper-content>
  136 + </v-stepper-items>
  137 + </v-stepper>
  138 + </v-app>
  139 + </div>
  140 + </v-flex>
  141 + </v-layout>
  142 + </v-container>
  143 + <v-footer class="pa-4" color="grey darken-2">
58 144 </v-footer>
59   - </v-app>
  145 + </v-app>
60 146 </template>
  147 +
  148 +
  149 +
61 150 <script>
62 151 import http from '@/Services/http.js';
63 152  
64 153 export default {
65 154 data: () => ({
66   - changePassword:'',
  155 + e1: true,
  156 + e2:0,
67 157 snackbar: false,
68 158 y: 'top',
69 159 x: 'right',
... ... @@ -71,18 +161,53 @@ export default {
71 161 timeout: 4000,
72 162 text: '',
73 163 loading: false,
74   - email: ''
  164 + email: '',
  165 + forgetemail:'',
  166 + password:'',
  167 + changepassword:'',
  168 + emailRules: [
  169 + v => !!v || "Email is required"
  170 +
  171 + ],
  172 + rules: {
  173 + required: value => !!value || "password is Required.",
  174 + min: v =>
  175 + (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/.test(
  176 + v
  177 + ) &&
  178 + v.length >= 6) ||
  179 + "Min 4 characters upper case lower case symbol required"
  180 + }
75 181 }),
76 182  
77 183 methods: {
78 184 reset () {
79   -
80   - http().get('/schoolForgotPassword?email='+ this.changePassword)
  185 + http().get('/schoolForgotPassword?email='+ this.forgetemail)
  186 + .then(response => {
  187 + // console.log("response=====>",response.data.data.token);
  188 + this.$store.dispatch("setToken", response.data.data.token);
  189 + this.loading = true;
  190 + if(this.snackbar=true){
  191 + this.text= "Please you Fill Last Step of Forget Password!"
  192 + }
  193 + }).catch(err => {
  194 + this.text="User Not Found or Incorrect Email"
  195 + this.snackbar= true;
  196 + this.loading = false;
  197 + })
  198 + },
  199 + resetPassword(){
  200 + let forgotPassword = {
  201 + resetToken: this.$store.state.token,
  202 + email: this.email,
  203 + password: this.changepassword
  204 + }
  205 + http().post('/schoolResetPassword',forgotPassword)
81 206 .then(response => {
82 207 console.log("response=====>",response);
83 208 this.loading = true;
84 209 if(this.snackbar=true){
85   - this.text= "Please check your email and Copy your password!"
  210 + this.text= "Successfully Change your Password"
86 211 }
87 212 setTimeout(() => {
88 213 this.$router.push('/');
... ... @@ -101,8 +226,7 @@ export default {
101 226 }
102 227  
103 228 };
104   -</script>
105   -<style scoped lang="css">
  229 +</script>undefined<style scoped lang="css">
106 230 #login {
107 231 height: 50%;
108 232 width: 100%;
... ...