Commit 9913d224 authored by 李苏's avatar 李苏 💬

侧边栏优化,拦截403重新登录

parent 21eebe27
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div v-if="!item.hidden"> <div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
<el-menu-item style="padding-left: 25px;":index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> <el-menu-item :style="sidebar.opened?'padding-left: 25px;':'padding-left: 0px;'" :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> --> <!-- <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> -->
<div style="display: inline-block;text-align: center;" :class="{'open':!sidebar.opened,'close':sidebar.opened}"> <div style="display: inline-block;text-align: center;" :class="{'open':!sidebar.opened,'close':sidebar.opened}">
...@@ -124,5 +124,7 @@ export default { ...@@ -124,5 +124,7 @@ export default {
.open{ .open{
width: 54px; width: 54px;
} }
/deep/.el-submenu .is-opened{
}
</style> </style>
...@@ -63,7 +63,22 @@ service.interceptors.response.use(res => { ...@@ -63,7 +63,22 @@ service.interceptors.response.use(res => {
}); });
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) { } else if(code === 403){
MessageBox.confirm('您无权处理该资源,您可以联系相关管理员,获取权限', '系统提示', {
confirmButtonText: '重新登录',
showCancelButton:false,
showClose:false,
closeOnClickModal:false,
type: 'warning'
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
location.href = '/index';
})
})
}
else if (code === 500) {
Message({ Message({
message: msg, message: msg,
type: 'error' type: 'error'
......
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