Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ds147000
/
react-project-storage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit da53ce0d
authored
Jul 22, 2020
by
GGbong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改401页面提示
1 parent
b95a07dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
src/router/modules/basisRoute.js
src/router/router-view.js
src/view/error/401.js
src/router/modules/basisRoute.js
View file @
da53ce0
import
loadable
from
'@loadable/component'
import
loadable
from
'@loadable/component'
const
exact
=
true
const
exact
=
true
export
default
[
export
default
[
]
{
\ No newline at end of file
url
:
'/404'
,
exact
,
component
:
loadable
(()
=>
import
(
'@/view/error/404'
))
// 懒加载
}
]
\ No newline at end of file
src/router/router-view.js
View file @
da53ce0
...
@@ -78,7 +78,7 @@ const RouterView = ({ basisRoute = [], serviceRoute = [], userRoute = [], userSa
...
@@ -78,7 +78,7 @@ const RouterView = ({ basisRoute = [], serviceRoute = [], userRoute = [], userSa
<
Switch
>
<
Switch
>
{
basisRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
{
basisRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
{
openRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
{
openRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
<
Route
component
=
{
error401
}
/
>
<
Route
component
=
{
Guards
(
error401
)
}
/
>
<
/Switch
>
<
/Switch
>
<
/Layout
>
<
/Layout
>
)
)
...
@@ -86,7 +86,7 @@ const RouterView = ({ basisRoute = [], serviceRoute = [], userRoute = [], userSa
...
@@ -86,7 +86,7 @@ const RouterView = ({ basisRoute = [], serviceRoute = [], userRoute = [], userSa
return
(
return
(
<
Switch
>
<
Switch
>
{
fullScreenRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
{
fullScreenRoute
.
map
(
e
=>
<
Route
path
=
{
e
.
url
}
exact
=
{
e
.
exact
}
component
=
{
Guards
(
e
.
component
)}
key
=
{
e
.
url
}
/>
)
}
<
Route
component
=
{
error404
}
/
>
<
Route
component
=
{
Guards
(
error404
)
}
/
>
<
/Switch
>
<
/Switch
>
)
)
}
}
...
...
src/view/error/401.js
View file @
da53ce0
...
@@ -3,7 +3,7 @@ import React from 'react'
...
@@ -3,7 +3,7 @@ import React from 'react'
const
Page
=
({
history
})
=>
{
const
Page
=
({
history
})
=>
{
return
(
return
(
<
div
>
<
div
>
<
h1
onClick
=
{()
=>
history
.
push
(
'/'
)}
>
40
4
错误
,
点击回到首页
<
/h1
>
<
h1
onClick
=
{()
=>
history
.
push
(
'/'
)}
>
40
1
,
暂无权限。
点击回到首页
<
/h1
>
<
/div
>
<
/div
>
)
)
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment