Commit b24b1cfb authored by 徐一鸣's avatar 徐一鸣

服务管理及应用管理增加权限控制

parent 9df8960f
...@@ -16,9 +16,9 @@ export default { ...@@ -16,9 +16,9 @@ export default {
getCurrentUser() { getCurrentUser() {
this.$api.user.getNowUser().then(({ data }) => { this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) { if (data.success == 1) {
console.log("--- user info ---"); console.log("--- --- ---");
console.log(data.data); console.log(data.data);
console.log("--- user info ---"); console.log("--- --- ---");
this.$store.commit("userInfofun", data.data); this.$store.commit("userInfofun", data.data);
} else { } else {
......
...@@ -1137,7 +1137,23 @@ export default { ...@@ -1137,7 +1137,23 @@ export default {
this.level = parseInt(this.$route.params.level); this.level = parseInt(this.$route.params.level);
this.type = parseInt(this.$route.params.type); this.type = parseInt(this.$route.params.type);
this.initHeader(); this.initHeader();
this.initFilter();
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
this.$store.commit("userInfofun", data.data);
const userLevel = this.$store.getters.level;
if (userLevel == this.level) {
this.initFilter();
} else {
console.log("用户没有当前页面的权限,即将跳转...");
this.$router.push(`/fwgl/${userLevel}/${this.type}`);
}
} else {
console.log(data.errMsg);
}
});
}, },
}; };
</script> </script>
......
...@@ -1362,7 +1362,23 @@ export default { ...@@ -1362,7 +1362,23 @@ export default {
this.level = parseInt(this.$route.params.level); this.level = parseInt(this.$route.params.level);
this.type = parseInt(this.$route.params.type); this.type = parseInt(this.$route.params.type);
this.initHeader(); this.initHeader();
this.initFilter();
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
this.$store.commit("userInfofun", data.data);
const userLevel = this.$store.getters.level;
if (userLevel == this.level) {
this.initFilter();
} else {
console.log("用户没有当前页面的权限,即将跳转...");
this.$router.push(`/yygl/${userLevel}/${this.type}`);
}
} else {
console.log(data.errMsg);
}
});
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment