diff --git a/src/Services/http.js b/src/Services/http.js
index 18cd03d..bcd38b0 100644
--- a/src/Services/http.js
+++ b/src/Services/http.js
@@ -3,7 +3,7 @@ import store from '@/store/store'
export default () => {
return axios.create({
- // baseURL: 'http://192.168.0.101:3002/v1',
+ // baseURL: 'http://192.168.2.221:3002/v1',
baseURL: 'http://13.234.251.173:8001/v1',
headers: {
Authorization: `Bearer ${store.state.token}`
diff --git a/src/api/menu.js b/src/api/menu.js
index c0fd962..b6b640c 100644
--- a/src/api/menu.js
+++ b/src/api/menu.js
@@ -1,4 +1,4 @@
-const Menu = [
+const adminMenu = [
// { header: 'Apps' },
{
title: 'Dashboard',
@@ -181,16 +181,25 @@ const Menu = [
}
];
+const schoolMenu = [
+ // { header: 'Apps' },
+ {
+ title: 'School',
+ // group: 'apps',
+ path: '/school',
+ icon: '/static/schoolIcons/Dashboard.png',
+ },
+];
// reorder menu
-Menu.forEach((item) => {
- // if (item.items) {
- // item.items.sort((x, y) => {
- // let textA = x.title.toUpperCase();
- // let textB = y.title.toUpperCase();
- // return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
- // });
- // }
-});
+// Menu.forEach((item) => {
+// if (item.items) {
+// item.items.sort((x, y) => {
+// let textA = x.title.toUpperCase();
+// let textB = y.title.toUpperCase();
+// return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
+// });
+// }
+// });
-export default Menu;
\ No newline at end of file
+export default { adminMenu, schoolMenu };
\ No newline at end of file
diff --git a/src/components/pageHeader/AppDrawer.vue b/src/components/pageHeader/AppDrawer.vue
index 0ed1cb4..1803bb3 100644
--- a/src/components/pageHeader/AppDrawer.vue
+++ b/src/components/pageHeader/AppDrawer.vue
@@ -129,7 +129,7 @@ export default {
data: () => ({
mini: false,
drawer: true,
- menus: menu,
+ menus: [],
scrollSettings: {
maxScrollbarLength: 160
}
@@ -147,6 +147,11 @@ export default {
}
},
created() {
+ if (this.$store.state.role === "ADMIN") {
+ this.menus = menu.adminMenu;
+ } else if (this.$store.state.role === "SUPERADMIN") {
+ this.menus = menu.schoolMenu;
+ }
window.getApp.$on("APP_DRAWER_TOGGLED", () => {
this.drawer = !this.drawer;
});
@@ -177,9 +182,11 @@ export default {
overflow: auto;
}
}
+
.v-list__group__items--no-action .v-list__tile {
- padding-left: 72px !important;
+ padding-left: 72px !important;
}
+
.v-list--dense .v-list__tile:not(.v-list__tile--avatar) {
height: 60px;
font-size: 17px;
diff --git a/src/event.js b/src/event.js
index 868dc41..f604c76 100644
--- a/src/event.js
+++ b/src/event.js
@@ -1,76 +1,75 @@
-export default [
- {
- name: 'APP_LOGIN_SUCCESS',
- callback: function (e) {
- this.$router.push({ path: 'dashboard' });
- }
- },
- {
- name: 'APP_LOGOUT',
- callback: function (e) {
- this.snackbar = {
- show: true,
- color: 'green',
- text: 'Logout successfully.'
- };
- this.$store.dispatch('setToken', null)
- this.$store.dispatch('Id', null)
- this.$router.replace({ path: '/' });
- }
- },
- {
- name: 'APP_CHANGE',
- callback: function (e) {
- this.snackbar = {
- show: true,
- color: 'green',
- text: 'Logout successfully.'
- };
- this.$router.replace({
- path: '/'
- });
- }
- },
- {
- name: 'APP_PAGE_LOADED',
- callback: function (e) {
- }
- },
- {
- name: 'APP_AUTH_FAILED',
- callback: function (e) {
- this.$router.push('/login');
- this.$message.error('Token has expired');
- }
- },
- {
- name: 'APP_BAD_REQUEST',
- // @error api response data
- callback: function (msg) {
- this.$message.error(msg);
- }
- },
- {
- name: 'APP_ACCESS_DENIED',
- // @error api response data
- callback: function (msg) {
- this.$message.error(msg);
- this.$router.push('/forbidden');
- }
- },
- {
- name: 'APP_RESOURCE_DELETED',
- // @error api response data
- callback: function (msg) {
- this.$message.success(msg);
- }
- },
- {
- name: 'APP_RESOURCE_UPDATED',
- // @error api response data
- callback: function (msg) {
- this.$message.success(msg);
- }
- },
+export default [{
+ name: 'APP_LOGIN_SUCCESS',
+ callback: function(e) {
+ this.$router.push({ path: 'dashboard' });
+ }
+ },
+ {
+ name: 'APP_LOGOUT',
+ callback: function(e) {
+ this.snackbar = {
+ show: true,
+ color: 'green',
+ text: 'Logout successfully.'
+ };
+ this.$store.dispatch('setToken', null)
+ this.$store.dispatch('Id', null)
+ this.$store.dispatch('Role', null)
+ this.$router.replace({ path: '/' });
+ }
+ },
+ {
+ name: 'APP_CHANGE',
+ callback: function(e) {
+ this.snackbar = {
+ show: true,
+ color: 'green',
+ text: 'Logout successfully.'
+ };
+ this.$router.replace({
+ path: '/'
+ });
+ }
+ },
+ {
+ name: 'APP_PAGE_LOADED',
+ callback: function(e) {}
+ },
+ {
+ name: 'APP_AUTH_FAILED',
+ callback: function(e) {
+ this.$router.push('/login');
+ this.$message.error('Token has expired');
+ }
+ },
+ {
+ name: 'APP_BAD_REQUEST',
+ // @error api response data
+ callback: function(msg) {
+ this.$message.error(msg);
+ }
+ },
+ {
+ name: 'APP_ACCESS_DENIED',
+ // @error api response data
+ callback: function(msg) {
+ this.$message.error(msg);
+ this.$router.push('/forbidden');
+ }
+ },
+ {
+ name: 'APP_RESOURCE_DELETED',
+ // @error api response data
+ callback: function(msg) {
+ this.$message.success(msg);
+ }
+ },
+ {
+ name: 'APP_RESOURCE_UPDATED',
+ // @error api response data
+ callback: function(msg) {
+ this.$message.success(msg);
+ }
+ },
-];
+];
\ No newline at end of file
diff --git a/src/pages/Attendence/viewStudentsAttendence.vue b/src/pages/Attendence/viewStudentsAttendence.vue
index 0bf63df..a29b9e0 100644
--- a/src/pages/Attendence/viewStudentsAttendence.vue
+++ b/src/pages/Attendence/viewStudentsAttendence.vue
@@ -410,7 +410,7 @@ export default {
}
let doc = new jsPDF();
doc.addImage(this.output, 'JPEG', 5, 10, 200, 280);
- doc.save("export.pdf");
+ doc.save("Attendance.pdf");
}
}
};
diff --git a/src/pages/Authentication/Login.vue b/src/pages/Authentication/Login.vue
index 1b9be62..6e1cec2 100644
--- a/src/pages/Authentication/Login.vue
+++ b/src/pages/Authentication/Login.vue
@@ -122,8 +122,14 @@ export default {
.then(response => {
this.$store.dispatch("setToken", response.data.data.token);
this.$store.dispatch("Id", response.data.data.id);
+ this.$store.dispatch("Role", response.data.data.role);
this.loading = false;
- this.$router.push("/dashboard");
+ // console.log("{this.$store.state.state.role}",this.$store.state.role)
+ if (this.$store.state.role === "ADMIN") {
+ this.$router.push("/dashboard");
+ } else if (this.$store.state.role === "SUPERADMIN") {
+ this.$router.push("/school");
+ }
})
.catch(error => {
if (error) {
diff --git a/src/pages/Mark/viewMark.vue b/src/pages/Mark/viewMark.vue
index 90063fd..f758758 100644
--- a/src/pages/Mark/viewMark.vue
+++ b/src/pages/Mark/viewMark.vue
@@ -91,6 +91,11 @@
+ No Data Found
+ No Data Found
+