Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sgaqgl-vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李苏
sgaqgl-vue
Commits
9913d224
Commit
9913d224
authored
Nov 14, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
侧边栏优化,拦截403重新登录
parent
21eebe27
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
SidebarItem.vue
src/layout/components/Sidebar/SidebarItem.vue
+3
-1
request.js
src/utils/request.js
+16
-1
No files found.
src/layout/components/Sidebar/SidebarItem.vue
View file @
9913d224
...
@@ -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
>
src/utils/request.js
View file @
9913d224
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment