Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
036e934a
Commit
036e934a
authored
Jun 21, 2023
by
李鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
c2cd7c2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
src/router/index.js
src/router/index.js
+36
-0
No files found.
src/router/index.js
View file @
036e934a
...
...
@@ -6,6 +6,7 @@ import store from "../store";
//写入初始必须有的路由
//或者隐藏式路由,不会表现在菜单上,但是需要存在的路由
<<<<<<<
Updated
upstream
const
routes
=
[{
path
:
"
/login
"
,
name
:
"
login
"
,
...
...
@@ -39,6 +40,31 @@ const routes = [{
component
:
()
=>
import
(
"
../page/404.vue
"
),
},
=======
const
routes
=
[
{
path
:
"
/login
"
,
name
:
"
login
"
,
show
:
true
,
component
:
()
=>
import
(
"
../page/login/index.vue
"
),
},
{
path
:
"
/register
"
,
name
:
"
register
"
,
show
:
true
,
component
:
()
=>
import
(
"
../page/register/index.vue
"
),
},
{
path
:
"
/
"
,
name
:
"
index
"
,
component
:
()
=>
import
(
"
../page/welcom.vue
"
),
},
{
path
:
"
/404
"
,
show
:
true
,
component
:
()
=>
import
(
"
../page/404.vue
"
),
},
>>>>>>>
Stashed
changes
];
//重新创建router
...
...
@@ -63,6 +89,16 @@ function inWhiteList(toPath) {
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
<<<<<<<
Updated
upstream
=======
const
userInfo
=
store
.
state
.
userInfo
;
//已登录不可跳转登陆页 || to.path == "/" 去除首页跳转判断
if
(
userInfo
&&
to
.
path
==
"
/login
"
)
{
return
next
({
path
:
"
/
"
,
});
}
>>>>>>>
Stashed
changes
const
userInfo
=
store
.
state
.
userInfo
...
...
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