This commit is contained in:
duanxiaohai 2024-09-25 16:31:57 +08:00
parent 496057ae5c
commit f0af8c328e
4 changed files with 45 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -17,15 +17,15 @@ const router = createRouter({
path: "/guide", path: "/guide",
component: () => import("../view/guide.vue"), component: () => import("../view/guide.vue"),
}, },
{
name: "权限",
path: "/error/noPermission",
component: () => import("../view/error/noPermission.vue"),
},
{ {
path: "/home", path: "/home",
component: () => import("../view/home.vue"), component: () => import("../view/home.vue"),
children: [ children: [
// {
// name: '登录',
// path: '/login/index',
// component: () => import('../view/login/LoginZZD.vue'),
// },
{ {
name: "首页", name: "首页",
path: "/home/index", path: "/home/index",
@ -128,8 +128,6 @@ router.beforeEach((to, form, next) => {
// } // }
let type = tools.data.get("type"); let type = tools.data.get("type");
if (type) { if (type) {
console.log(1111);
next(); next();
} else { } else {
window.location.href = "http://localhost:8080/#/guide"; window.location.href = "http://localhost:8080/#/guide";

View File

@ -0,0 +1,37 @@
<template>
<div class="error_main">
<img class="error_main_img" src="@/assets/errorimg/error3.png" alt="" />
<div class="error_main_content">账号没权限请联系管理员</div>
</div>
</template>
<style lang="scss">
.error_main {
width: 100%;
max-width: 500px;
padding: 200px 30px 0;
box-sizing: border-box;
display: flex;
align-items: center;
flex-direction: column;
margin: 0 auto;
.error_main_img {
width: 300px;
height: 300px;
}
.error_main_content {
text-align: center;
margin-top: 5px;
font-size: 14px;
padding: 0 60px;
box-sizing: border-box;
color: #666874;
font-weight: 500;
margin-bottom: 26px;
line-height: 48px;
}
}
</style>

View File

@ -176,11 +176,9 @@ const login = () => {
// } // }
tools.data.set("type", 1); tools.data.set("type", 1);
} else { } else {
// //
this.loading = false; router.push({
ElMessage.error({ path: `error/noPermission.vue`,
message: "请重新登录!",
offset: 100,
}); });
} }
}); });