Commit 00e4bc4e16dd33a9719371e0ca7ea14da5bc9d0b
1 parent
37150e7c18
Exists in
master
and in
3 other branches
fixed auntentication
Showing
26 changed files
with
117 additions
and
58 deletions
Show diff stats
src/pages/Account/editInvoice.vue
... | ... | @@ -383,8 +383,14 @@ export default { |
383 | 383 | (this.feeType.subTotal = response.data.data.totalSubTotal), |
384 | 384 | (this.showLoader = false); |
385 | 385 | }) |
386 | - .catch(err => { | |
386 | + .catch(error => { | |
387 | 387 | this.showLoader = false; |
388 | + if (error.response.status === 401) { | |
389 | + this.$router.replace({ path: "/" }); | |
390 | + this.$store.dispatch("setToken", null); | |
391 | + this.$store.dispatch("Id", null); | |
392 | + this.$store.dispatch("Role", null); | |
393 | + } | |
388 | 394 | }); |
389 | 395 | }, |
390 | 396 | selectFeeType() { |
... | ... | @@ -414,8 +420,15 @@ export default { |
414 | 420 | .then(response => { |
415 | 421 | this.addclass = response.data.data; |
416 | 422 | }) |
417 | - .catch(err => { | |
423 | + .catch(error => { | |
418 | 424 | // console.log("err====>", err); |
425 | + this.showLoader = false; | |
426 | + if (error.response.status === 401) { | |
427 | + this.$router.replace({ path: "/" }); | |
428 | + this.$store.dispatch("setToken", null); | |
429 | + this.$store.dispatch("Id", null); | |
430 | + this.$store.dispatch("Role", null); | |
431 | + } | |
419 | 432 | }); |
420 | 433 | }, |
421 | 434 | getAllStudents() { |
... | ... | @@ -534,10 +547,10 @@ table.feeTypeTable { |
534 | 547 | width: 100% !important; |
535 | 548 | } |
536 | 549 | @media screen and (max-width: 380px) { |
537 | - .tableRsponsive { | |
538 | - display: block; | |
539 | - position: relative; | |
540 | - overflow: scroll; | |
541 | - } | |
550 | + .tableRsponsive { | |
551 | + display: block; | |
552 | + position: relative; | |
553 | + overflow: scroll; | |
554 | + } | |
542 | 555 | } |
543 | 556 | </style> |
544 | 557 | \ No newline at end of file | ... | ... |
src/pages/Account/feeTypes.vue
... | ... | @@ -337,20 +337,20 @@ export default { |
337 | 337 | this.showLoader = false; |
338 | 338 | // console.log("getAllfeetypes=====>",response.data.data) |
339 | 339 | }) |
340 | - .catch(err => { | |
340 | + .catch(error => { | |
341 | 341 | // console.log("err====>", err); |
342 | 342 | this.showLoader = false; |
343 | 343 | if (error.response.status === 401) { |
344 | 344 | this.$router.replace({ path: "/" }); |
345 | 345 | this.$store.dispatch("setToken", null); |
346 | 346 | this.$store.dispatch("Id", null); |
347 | + this.$store.dispatch("Role", null); | |
347 | 348 | } |
348 | 349 | }); |
349 | 350 | }, |
350 | 351 | editItem(item) { |
351 | 352 | this.editedIndex = this.feeTypeList.indexOf(item); |
352 | 353 | this.editedItem = Object.assign({}, item); |
353 | - console.log(this.editedItem); | |
354 | 354 | this.dialog = true; |
355 | 355 | }, |
356 | 356 | profile(item) { | ... | ... |
src/pages/Account/paymentHistory.vue
src/pages/Account/viewInvoice.vue
... | ... | @@ -169,8 +169,14 @@ export default { |
169 | 169 | (this.showLoader = false) |
170 | 170 | )); |
171 | 171 | }) |
172 | - .catch(err => { | |
172 | + .catch(error => { | |
173 | 173 | this.showLoader = false; |
174 | + if (error.response.status === 401) { | |
175 | + this.$router.replace({ path: "/" }); | |
176 | + this.$store.dispatch("setToken", null); | |
177 | + this.$store.dispatch("Id", null); | |
178 | + this.$store.dispatch("Role", null); | |
179 | + } | |
174 | 180 | }); |
175 | 181 | }, |
176 | 182 | getfeeType() { | ... | ... |
src/pages/Administrator/role.vue
src/pages/Attendence/viewStudentsAttendence.vue
... | ... | @@ -340,12 +340,12 @@ export default { |
340 | 340 | this.activeDates = array; |
341 | 341 | }) |
342 | 342 | .catch(error => { |
343 | - console.log("err====>", err); | |
344 | 343 | this.showLoader = false; |
345 | 344 | if (error.response.status === 401) { |
346 | 345 | this.$router.replace({ path: "/" }); |
347 | 346 | this.$store.dispatch("setToken", null); |
348 | 347 | this.$store.dispatch("Id", null); |
348 | + this.$store.dispatch("Role", null); | |
349 | 349 | } |
350 | 350 | }); |
351 | 351 | }, | ... | ... |
src/pages/Authentication/changepassword.vue
... | ... | @@ -101,11 +101,17 @@ export default { |
101 | 101 | this.$router.push("/dashboard"); |
102 | 102 | }, 2000); |
103 | 103 | }) |
104 | - .catch(err => { | |
104 | + .catch(error => { | |
105 | 105 | // console.log("err====>",err); |
106 | 106 | this.text = "User Not Found or Incorrect currentPassword"; |
107 | 107 | this.snackbar = true; |
108 | 108 | this.loading = false; |
109 | + if (error.response.status === 401) { | |
110 | + this.$router.replace({ path: "/" }); | |
111 | + this.$store.dispatch("setToken", null); | |
112 | + this.$store.dispatch("Id", null); | |
113 | + this.$store.dispatch("Role", null); | |
114 | + } | |
109 | 115 | }); |
110 | 116 | } |
111 | 117 | }, | ... | ... |
src/pages/Class/addclass.vue
... | ... | @@ -273,8 +273,7 @@ export default { |
273 | 273 | this.desserts = response.data.data; |
274 | 274 | this.showLoader = false; |
275 | 275 | }) |
276 | - .catch(err => { | |
277 | - console.log("err====>", err); | |
276 | + .catch(error => { | |
278 | 277 | this.showLoader = false; |
279 | 278 | if (error.response.status === 401) { |
280 | 279 | this.$router.replace({ path: "/" }); | ... | ... |
src/pages/Dashboard/dashboard.vue
... | ... | @@ -56,7 +56,12 @@ |
56 | 56 | <!-- ***** Total Class***** --> |
57 | 57 | <v-flex xs12 sm12 lg3 md4> |
58 | 58 | <v-card width="90" height="90" class="ml-3 pa-1 white khasraIcon" dark> |
59 | - <img src="/static/schoolIcons/Class.png" width="80" class="iconOfDashboard" alt="class" /> | |
59 | + <img | |
60 | + src="/static/schoolIcons/Class.png" | |
61 | + width="80" | |
62 | + class="iconOfDashboard" | |
63 | + alt="class" | |
64 | + /> | |
60 | 65 | </v-card> |
61 | 66 | <v-card class="pa-3" style="margin-top: -44px;"> |
62 | 67 | <div class="body-2 grey--text text-xs-right">Class</div> |
... | ... | @@ -187,6 +192,7 @@ export default { |
187 | 192 | this.$router.replace({ path: "/" }); |
188 | 193 | this.$store.dispatch("setToken", null); |
189 | 194 | this.$store.dispatch("Id", null); |
195 | + this.$store.dispatch("Role", null); | |
190 | 196 | } |
191 | 197 | }); |
192 | 198 | http() |
... | ... | @@ -207,6 +213,7 @@ export default { |
207 | 213 | this.$router.replace({ path: "/" }); |
208 | 214 | this.$store.dispatch("setToken", null); |
209 | 215 | this.$store.dispatch("Id", null); |
216 | + this.$store.dispatch("Role", null); | |
210 | 217 | } |
211 | 218 | }); |
212 | 219 | }, |
... | ... | @@ -219,7 +226,7 @@ export default { |
219 | 226 | this.students = response.data.data; |
220 | 227 | this.showLoader = false; |
221 | 228 | }) |
222 | - .catch(err => { | |
229 | + .catch(error => { | |
223 | 230 | // console.log("err====>", err); |
224 | 231 | this.showLoader = false; |
225 | 232 | if (error.response.status === 401) { |
... | ... | @@ -238,7 +245,7 @@ export default { |
238 | 245 | this.parents = response.data.data; |
239 | 246 | this.showLoader = false; |
240 | 247 | }) |
241 | - .catch(err => { | |
248 | + .catch(error => { | |
242 | 249 | // console.log("err====>", err); |
243 | 250 | this.showLoader = false; |
244 | 251 | if (error.response.status === 401) { |
... | ... | @@ -257,7 +264,7 @@ export default { |
257 | 264 | this.teachers = response.data.data; |
258 | 265 | this.showLoader = false; |
259 | 266 | }) |
260 | - .catch(err => { | |
267 | + .catch(error => { | |
261 | 268 | // console.log("err====>", err); |
262 | 269 | this.showLoader = false; |
263 | 270 | if (error.response.status === 401) { |
... | ... | @@ -276,13 +283,13 @@ export default { |
276 | 283 | this.classes = response.data.data; |
277 | 284 | this.showLoader = false; |
278 | 285 | }) |
279 | - .catch(err => { | |
280 | - // console.log("err====>", err); | |
286 | + .catch(error => { | |
281 | 287 | this.showLoader = false; |
282 | 288 | if (error.response.status === 401) { |
283 | 289 | this.$router.replace({ path: "/" }); |
284 | 290 | this.$store.dispatch("setToken", null); |
285 | 291 | this.$store.dispatch("Id", null); |
292 | + this.$store.dispatch("Role", null); | |
286 | 293 | } |
287 | 294 | }); |
288 | 295 | } | ... | ... |
src/pages/Event/event.vue
... | ... | @@ -411,7 +411,7 @@ export default { |
411 | 411 | this.desserts = response.data.data; |
412 | 412 | this.showLoader = false; |
413 | 413 | }) |
414 | - .catch(err => { | |
414 | + .catch(error => { | |
415 | 415 | // console.log("err====>", err); |
416 | 416 | this.showLoader = false; |
417 | 417 | if (error.response.status === 401) { | ... | ... |
src/pages/Library/eBook.vue
... | ... | @@ -543,7 +543,7 @@ export default { |
543 | 543 | this.eBookData = response.data.data; |
544 | 544 | this.showLoader = false; |
545 | 545 | }) |
546 | - .catch(err => { | |
546 | + .catch(error => { | |
547 | 547 | // console.log("err====>", err); |
548 | 548 | this.showLoader = false; |
549 | 549 | if (error.response.status === 401) { | ... | ... |
src/pages/Library/issue.vue
src/pages/Library/member.vue
... | ... | @@ -633,12 +633,13 @@ export default { |
633 | 633 | this.studentData = response.data.data; |
634 | 634 | this.showLoader = false; |
635 | 635 | }) |
636 | - .catch(err => { | |
636 | + .catch(error => { | |
637 | 637 | // console.log("err====>", err); |
638 | 638 | if (error.response.status === 401) { |
639 | 639 | this.$router.replace({ path: "/" }); |
640 | 640 | this.$store.dispatch("setToken", null); |
641 | 641 | this.$store.dispatch("Id", null); |
642 | + this.$store.dispatch("Role", null); | |
642 | 643 | } |
643 | 644 | }); |
644 | 645 | }, | ... | ... |
src/pages/Mark/mark.vue
src/pages/Mark/promotion.vue
... | ... | @@ -216,8 +216,14 @@ export default { |
216 | 216 | .then(response => { |
217 | 217 | this.classList = response.data.data; |
218 | 218 | }) |
219 | - .catch(err => { | |
220 | - // console.log("err====>", err); | |
219 | + .catch(error => { | |
220 | + this.showLoader = false; | |
221 | + if (error.response.status === 401) { | |
222 | + this.$router.replace({ path: "/" }); | |
223 | + this.$store.dispatch("setToken", null); | |
224 | + this.$store.dispatch("Id", null); | |
225 | + this.$store.dispatch("Role", null); | |
226 | + } | |
221 | 227 | }); |
222 | 228 | } |
223 | 229 | } | ... | ... |
src/pages/News/news.vue
... | ... | @@ -532,7 +532,7 @@ export default { |
532 | 532 | this.showLoader = false; |
533 | 533 | // console.log("getNewsList=====>",this.desserts) |
534 | 534 | }) |
535 | - .catch(err => { | |
535 | + .catch(error => { | |
536 | 536 | // console.log("err====>", err); |
537 | 537 | this.showLoader = false; |
538 | 538 | if (error.response.status === 401) { | ... | ... |
src/pages/NoticeBoard/noticeBoard.vue
... | ... | @@ -456,7 +456,7 @@ export default { |
456 | 456 | this.desserts = response.data.data; |
457 | 457 | this.showLoader = false; |
458 | 458 | }) |
459 | - .catch(err => { | |
459 | + .catch(error => { | |
460 | 460 | this.showLoader = false; |
461 | 461 | if (error.response.status === 401) { |
462 | 462 | this.$router.replace({ path: "/" }); | ... | ... |
src/pages/Notification/notification.vue
... | ... | @@ -363,7 +363,7 @@ export default { |
363 | 363 | this.showLoader = false; |
364 | 364 | // console.log("getNotifications=====>",this.desserts) |
365 | 365 | }) |
366 | - .catch(err => { | |
366 | + .catch(error => { | |
367 | 367 | // console.log("err====>", err); |
368 | 368 | this.showLoader = false; |
369 | 369 | if (error.response.status === 401) { | ... | ... |
src/pages/Parent/parents.vue
... | ... | @@ -628,7 +628,14 @@ export default { |
628 | 628 | this.parentsList = response.data.data; |
629 | 629 | }) |
630 | 630 | .catch(error => { |
631 | - console.log("err====>", error.response.data.message); | |
631 | + // console.log("err====>", error.response.data.message); | |
632 | + this.showLoader = false; | |
633 | + if (error.response.status === 401) { | |
634 | + this.$router.replace({ path: "/" }); | |
635 | + this.$store.dispatch("setToken", null); | |
636 | + this.$store.dispatch("Id", null); | |
637 | + this.$store.dispatch("Role", null); | |
638 | + } | |
632 | 639 | }); |
633 | 640 | } |
634 | 641 | }, | ... | ... |
src/pages/Reminder/reminder.vue
... | ... | @@ -453,7 +453,7 @@ export default { |
453 | 453 | this.showLoader = false; |
454 | 454 | // console.log("getRemindersList=====>",this.desserts) |
455 | 455 | }) |
456 | - .catch(err => { | |
456 | + .catch(error => { | |
457 | 457 | // console.log("err====>", err); |
458 | 458 | this.showLoader = false; |
459 | 459 | if (error.response.status === 401) { | ... | ... |
src/pages/Report/studentReport.vue
... | ... | @@ -349,7 +349,12 @@ export default { |
349 | 349 | }) |
350 | 350 | .catch(err => { |
351 | 351 | this.showLoader = false; |
352 | - // console.log("err====>", err); | |
352 | + if (error.response.status === 401) { | |
353 | + this.$router.replace({ path: "/" }); | |
354 | + this.$store.dispatch("setToken", null); | |
355 | + this.$store.dispatch("Id", null); | |
356 | + this.$store.dispatch("Role", null); | |
357 | + } | |
353 | 358 | }); |
354 | 359 | }, |
355 | 360 | getReport() { | ... | ... |
src/pages/School/school.vue
... | ... | @@ -1113,8 +1113,13 @@ export default { |
1113 | 1113 | this.showLoader = false; |
1114 | 1114 | }) |
1115 | 1115 | .catch(error => { |
1116 | - console.log("err====>", err); | |
1117 | 1116 | this.showLoader = false; |
1117 | + if (error.response.status === 401) { | |
1118 | + this.$router.replace({ path: "/" }); | |
1119 | + this.$store.dispatch("setToken", null); | |
1120 | + this.$store.dispatch("Id", null); | |
1121 | + this.$store.dispatch("Role", null); | |
1122 | + } | |
1118 | 1123 | }); |
1119 | 1124 | }, |
1120 | 1125 | pickFile() { |
... | ... | @@ -1148,19 +1153,9 @@ export default { |
1148 | 1153 | editItem(item) { |
1149 | 1154 | this.editedIndex = this.schoolList.indexOf(item); |
1150 | 1155 | this.editedItem = Object.assign({}, item); |
1151 | - // if(this.editedItem.dob != undefined){ | |
1152 | - // this.editedItem.dob = this.editedItem.dob.substring(0, 10) | |
1153 | - // }else if(this.editedItem.dob = undefined){ | |
1154 | - // this.editedItem.dob = '' | |
1155 | - // } | |
1156 | - this.editedItem.dob = | |
1157 | - this.editedItem.dob != undefined | |
1158 | - ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10)) | |
1159 | - : (this.editedItem.dob = ""); | |
1160 | 1156 | this.dialog = true; |
1161 | 1157 | }, |
1162 | 1158 | profile(item) { |
1163 | - console.log("item", item); | |
1164 | 1159 | this.editedIndex = this.schoolList.indexOf(item); |
1165 | 1160 | this.editedItem = Object.assign({}, item); |
1166 | 1161 | this.dialog1 = true; | ... | ... |
src/pages/Section/section.vue
... | ... | @@ -426,7 +426,7 @@ export default { |
426 | 426 | }) |
427 | 427 | .catch(error => { |
428 | 428 | this.showLoader = false; |
429 | - if (error.response.status === 401 && error.response.status === 401) { | |
429 | + if (error.response.status === 401) { | |
430 | 430 | this.$router.replace({ path: "/" }); |
431 | 431 | this.$store.dispatch("setToken", null); |
432 | 432 | this.$store.dispatch("Id", null); | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -1973,11 +1973,6 @@ export default { |
1973 | 1973 | this.editedItem.fatherCellNo = item.parentId.fatherCellNo; |
1974 | 1974 | this.editedItem.motherName = item.parentId.motherName; |
1975 | 1975 | this.editedItem.motherCellNo = item.parentId.motherCellNo; |
1976 | - // if(this.editedItem.dob != undefined){ | |
1977 | - // this.editedItem.dob = this.editedItem.dob.substring(0, 10) | |
1978 | - // }else if(this.editedItem.dob = undefined){ | |
1979 | - // this.editedItem.dob = '' | |
1980 | - // } | |
1981 | 1976 | this.editedItem.dob = |
1982 | 1977 | this.editedItem.dob != undefined |
1983 | 1978 | ? (this.editedItem.dob = this.editedItem.dob.substring(0, 10)) |
... | ... | @@ -2207,9 +2202,14 @@ export default { |
2207 | 2202 | .then(response => { |
2208 | 2203 | this.addclass = response.data.data; |
2209 | 2204 | }) |
2210 | - .catch(err => { | |
2211 | - // console.log("err====>", err); | |
2212 | - this.$router.replace({ path: "/" }); | |
2205 | + .catch(error => { | |
2206 | + this.showLoader = false; | |
2207 | + if (error.response.status === 401) { | |
2208 | + this.$router.replace({ path: "/" }); | |
2209 | + this.$store.dispatch("setToken", null); | |
2210 | + this.$store.dispatch("Id", null); | |
2211 | + this.$store.dispatch("Role", null); | |
2212 | + } | |
2213 | 2213 | }); |
2214 | 2214 | }, |
2215 | 2215 | created() { | ... | ... |
src/pages/Subjects/subjects.vue
... | ... | @@ -467,8 +467,7 @@ export default { |
467 | 467 | .then(response => { |
468 | 468 | this.classList = response.data.data; |
469 | 469 | }) |
470 | - .catch(err => { | |
471 | - // console.log("err====>", err); | |
470 | + .catch(error => { | |
472 | 471 | if (error.response.status === 401) { |
473 | 472 | this.$router.replace({ path: "/" }); |
474 | 473 | this.$store.dispatch("setToken", null); | ... | ... |
src/pages/TimeTable/timeTable.vue
... | ... | @@ -927,7 +927,6 @@ export default { |
927 | 927 | this.desserts = response.data.data; |
928 | 928 | }) |
929 | 929 | .catch(error => { |
930 | - console.log("err====>", error); | |
931 | 930 | if ((this.snackbar = true)) { |
932 | 931 | this.text = error.response.data.message; |
933 | 932 | this.text = error.response.data.statusText; |
... | ... | @@ -1286,8 +1285,14 @@ export default { |
1286 | 1285 | this.addclass = response.data.data; |
1287 | 1286 | // console.log("getClassesList=====>",this.addclass) |
1288 | 1287 | }) |
1289 | - .catch(err => { | |
1290 | - // console.log("err====>", err); | |
1288 | + .catch(error => { | |
1289 | + this.showLoader = false; | |
1290 | + if (error.response.status === 401) { | |
1291 | + this.$router.replace({ path: "/" }); | |
1292 | + this.$store.dispatch("setToken", null); | |
1293 | + this.$store.dispatch("Id", null); | |
1294 | + this.$store.dispatch("Role", null); | |
1295 | + } | |
1291 | 1296 | }); |
1292 | 1297 | |
1293 | 1298 | http() |
... | ... | @@ -1298,8 +1303,14 @@ export default { |
1298 | 1303 | this.addTeachers = response.data.data; |
1299 | 1304 | // console.log("getClassesList=====>",this.addTeachers) |
1300 | 1305 | }) |
1301 | - .catch(err => { | |
1302 | - // console.log("err====>", err); | |
1306 | + .catch(error => { | |
1307 | + this.showLoader = false; | |
1308 | + if (error.response.status === 401) { | |
1309 | + this.$router.replace({ path: "/" }); | |
1310 | + this.$store.dispatch("setToken", null); | |
1311 | + this.$store.dispatch("Id", null); | |
1312 | + this.$store.dispatch("Role", null); | |
1313 | + } | |
1303 | 1314 | }); |
1304 | 1315 | }, |
1305 | 1316 | created() { | ... | ... |