Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
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
finance-oa
finance-manage
Commits
9f5ed82c
Commit
9f5ed82c
authored
Dec 03, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态加载路由 页面刷新问题
parent
b7002448
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
ruoyi-ui/src/router/index.js
ruoyi-ui/src/router/index.js
+12
-2
ruoyi-ui/src/store/modules/permission.js
ruoyi-ui/src/store/modules/permission.js
+1
-0
ruoyi-ui/src/views/redirect.vue
ruoyi-ui/src/views/redirect.vue
+12
-0
No files found.
ruoyi-ui/src/router/index.js
View file @
9f5ed82c
...
@@ -26,6 +26,17 @@ import Layout from '@/layout'
...
@@ -26,6 +26,17 @@ import Layout from '@/layout'
// 公共路由
// 公共路由
export
const
constantRoutes
=
[
export
const
constantRoutes
=
[
{
path
:
'
/redirect
'
,
component
:
Layout
,
hidden
:
true
,
children
:
[
{
path
:
'
/redirect/:path*
'
,
component
:
()
=>
import
(
'
@/views/redirect
'
)
}
]
},
{
{
path
:
'
/login
'
,
path
:
'
/login
'
,
component
:
()
=>
import
(
'
@/views/login
'
),
component
:
()
=>
import
(
'
@/views/login
'
),
...
@@ -93,8 +104,7 @@ export const constantRoutes = [
...
@@ -93,8 +104,7 @@ export const constantRoutes = [
meta
:
{
title
:
'
修改生成配置
'
}
meta
:
{
title
:
'
修改生成配置
'
}
}
}
]
]
},
}
{
path
:
'
*
'
,
redirect
:
'
/404
'
,
hidden
:
true
}
]
]
export
default
new
Router
({
export
default
new
Router
({
...
...
ruoyi-ui/src/store/modules/permission.js
View file @
9f5ed82c
...
@@ -20,6 +20,7 @@ const permission = {
...
@@ -20,6 +20,7 @@ const permission = {
// 向后端请求路由数据
// 向后端请求路由数据
getRouters
().
then
(
res
=>
{
getRouters
().
then
(
res
=>
{
const
accessedRoutes
=
filterAsyncRouter
(
res
.
data
)
const
accessedRoutes
=
filterAsyncRouter
(
res
.
data
)
accessedRoutes
.
push
({
path
:
'
*
'
,
redirect
:
'
/404
'
,
hidden
:
true
})
commit
(
'
SET_ROUTES
'
,
accessedRoutes
)
commit
(
'
SET_ROUTES
'
,
accessedRoutes
)
resolve
(
accessedRoutes
)
resolve
(
accessedRoutes
)
})
})
...
...
ruoyi-ui/src/views/redirect.vue
0 → 100644
View file @
9f5ed82c
<
script
>
export
default
{
created
()
{
const
{
params
,
query
}
=
this
.
$route
const
{
path
}
=
params
this
.
$router
.
replace
({
path
:
'
/
'
+
path
,
query
})
},
render
:
function
(
h
)
{
return
h
()
// avoid warning message
}
}
</
script
>
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