diff --git a/src/router/index.js b/src/router/index.js index f299d07..26bfc7a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -12,6 +12,7 @@ import OuterUserIndex from "../views/OuterUserIndex"; import OuterHistory from "../views/OuterHistory"; import OuterAppForm from "../views/OuterAppForm"; import OuterAppDetail from "../views/OuterAppDetail"; +import NoAuthority from "../views/NoAuthority"; Vue.use(VueRouter) @@ -84,7 +85,13 @@ const routes = [ component: OuterAppDetail } ] + }, + { + path: '/noAuthority', + name: "无权限", + component: NoAuthority } + ] const router = new VueRouter({ diff --git a/src/views/NoAuthority.vue b/src/views/NoAuthority.vue new file mode 100644 index 0000000..fddcbd7 --- /dev/null +++ b/src/views/NoAuthority.vue @@ -0,0 +1,29 @@ + + + + + \ No newline at end of file diff --git a/src/views/OuterUserIndex.vue b/src/views/OuterUserIndex.vue index 9d77f02..1211b59 100644 --- a/src/views/OuterUserIndex.vue +++ b/src/views/OuterUserIndex.vue @@ -5,6 +5,8 @@ 姓名:{{ information.name }} 编号:{{ information.school_id }} + + 出入批准员 @@ -36,6 +38,7 @@ export default { } }, created() { + const _this = this diff --git a/src/views/StudentUserIndex.vue b/src/views/StudentUserIndex.vue index aaa8943..c909821 100644 --- a/src/views/StudentUserIndex.vue +++ b/src/views/StudentUserIndex.vue @@ -4,6 +4,8 @@ 姓名:{{ information.name }} 编号:{{ information.school_id }} + + 学生 diff --git a/src/views/TeacherUserIndex.vue b/src/views/TeacherUserIndex.vue index 5fe674c..399e38c 100644 --- a/src/views/TeacherUserIndex.vue +++ b/src/views/TeacherUserIndex.vue @@ -6,6 +6,8 @@ 姓名:{{ information.name }} 编号:{{ information.school_id }} + + 教师 @@ -41,7 +43,13 @@ export default { let id = window.location.pathname.split('/')[3]; - axios.get('http://localhost:8181/userDetail/findById/'+id).then(function (resp){ + let type = window.location.pathname.split('/')[2]; + axios.get('http://localhost:8181/user/checkUseridAndType/' + id + '/' + type).then(function (resp) { + if (resp.data != 'success') { + _this.$router.push("/NoAuthority") + } + }) + axios.get('http://localhost:8181/userDetail/findById/' + id).then(function (resp) { _this.information = resp.data })