Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
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
Administrator
bkunyun
Commits
ff445e1b
Commit
ff445e1b
authored
Sep 06, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: // 在产品页面下且未选择产品时 直接跳转home页面
parent
21a0273d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
index.tsx
src/views/MenuLayout/index.tsx
+4
-3
No files found.
src/views/MenuLayout/index.tsx
View file @
ff445e1b
...
...
@@ -9,7 +9,7 @@
import
{
Box
,
List
}
from
"@mui/material"
;
import
CurrentProject
from
"../Project/components/CurrentProject"
;
import
React
from
"react"
;
import
{
Outlet
,
useNavigate
}
from
"react-router-dom"
;
import
{
Outlet
,
useNavigate
,
useLocation
}
from
"react-router-dom"
;
import
style
from
"./index.module.css"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useStores
}
from
"@/store/index"
;
...
...
@@ -23,9 +23,10 @@ const MenuLayout = observer(() => {
const
navigate
=
useNavigate
();
const
productInfo
=
toJS
(
currentProjectStore
.
currentProductInfo
);
const
location
=
useLocation
();
// 未选择产品时 直接跳转home页面
if
(
!
productInfo
.
name
)
{
//
在产品页面下且
未选择产品时 直接跳转home页面
if
(
!
productInfo
.
name
&&
location
.
pathname
.
slice
(
0
,
8
)
===
"/product"
)
{
navigate
(
"/home"
);
}
...
...
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