Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sage-front-framework
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
郁骅焌
sage-front-framework
Commits
fda615ff
提交
fda615ff
authored
6月 09, 2020
作者:
郁骅焌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
404页面
上级
03394943
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
70 行增加
和
9 行删除
+70
-9
config.js
config/config.js
+15
-7
app.jsx
src/app.jsx
+17
-2
BasicLayout.jsx
src/layouts/BasicLayout.jsx
+3
-0
index.js
src/pages/exception/403/index.js
+11
-0
index.js
src/pages/exception/404/index.js
+12
-0
index.js
src/pages/exception/500/index.js
+12
-0
没有找到文件。
config/config.js
浏览文件 @
fda615ff
...
...
@@ -41,13 +41,17 @@ export default defineConfig({
],
},
{
path
:
'/404'
,
component
:
'./exception/404'
,
},
{
path
:
'/'
,
component
:
'../layouts/SecurityLayout'
,
routes
:
[
{
path
:
'/'
,
component
:
'../layouts/BasicLayout'
,
authority
:
[
'admin'
,
'user'
],
//
authority: ['admin', 'user'],
routes
:
[
{
path
:
'/'
,
...
...
@@ -59,12 +63,12 @@ export default defineConfig({
icon
:
'smile'
,
component
:
'./Welcome'
,
},
{
name
:
'list.table-list'
,
icon
:
'table'
,
path
:
'/list'
,
component
:
'./ListTableList'
,
},
//
{
//
name: 'list.table-list',
//
icon: 'table',
//
path: '/list',
//
component: './ListTableList',
//
},
{
path
:
'/system'
,
name
:
'system'
,
...
...
@@ -109,6 +113,10 @@ export default defineConfig({
},
],
},
{
path
:
'*'
,
component
:
'./exception/404'
,
},
],
},
],
...
...
src/app.jsx
浏览文件 @
fda615ff
export
function
patchRoutes
({
routes
})
{
// console.log(JSON.parse(localStorage.menuTree))
// console.log(routes)
// 添加不匹配路由跳转404页面
for
(
let
i
=
0
;
i
<
routes
.
length
;
i
++
)
{
if
(
routes
[
i
].
path
===
'/'
)
{
routes
[
i
].
routes
[
0
].
routes
.
forEach
(
item
=>
{
if
(
item
.
routes
&&
item
.
routes
.
length
!==
0
)
{
item
.
routes
.
push
(
{
path
:
'*'
,
exact
:
true
,
// redirect: '/404',
component
:
require
(
'@/pages/exception/404'
).
default
,
}
)
}
})
}
}
}
src/layouts/BasicLayout.jsx
浏览文件 @
fda615ff
...
...
@@ -240,7 +240,10 @@ const BasicLayout = (props) => {
* init variables
*/
console
.
log
(
props
.
children
)
return
(
<
div
className=
{
`sage-app-wrapper ${collapsed ? 'hideSidebar' : ''}`
}
>
<
div
className=
"sage-sidebar-container"
>
<
div
className=
"sidebar-logo-container"
>
...
...
src/pages/exception/403/index.js
0 → 100644
浏览文件 @
fda615ff
import
React
from
'react'
import
{
Link
}
from
'umi'
import
{
Result
,
Button
}
from
'antd'
export
default
()
=>
(
<
Result
status
=
'403'
title
=
'403'
style
=
{{
background
:
'none'
}}
subTitle
=
'抱歉,你无权访问该页面。'
extra
=
{
<
Link
to
=
"/"
>
<
Button
type
=
"primary"
>
返回首页
<
/Button
>
<
/Link
>
}
/
>
)
src/pages/exception/404/index.js
0 → 100644
浏览文件 @
fda615ff
import
React
from
'react'
import
{
Link
}
from
'umi'
import
{
Result
,
Button
}
from
'antd'
export
default
()
=>
(
<
Result
status
=
"404"
title
=
"404"
style
=
{{
background
:
'none'
}}
subTitle
=
'抱歉,你访问的页面不存在。'
extra
=
{
<
Link
to
=
"/"
>
<
Button
type
=
"primary"
>
返回首页
<
/Button
>
<
/Link
>
}
/
>
)
src/pages/exception/500/index.js
0 → 100644
浏览文件 @
fda615ff
import
React
from
'react'
import
{
Link
}
from
'umi'
import
{
Result
,
Button
}
from
'antd'
export
default
()
=>
(
<
Result
status
=
"500"
title
=
"500"
style
=
{{
background
:
'none'
}}
subTitle
=
'抱歉,服务器出错了。'
extra
=
{
<
Link
to
=
"/"
>
<
Button
type
=
"primary"
>
返回首页
<
/Button
>
<
/Link
>
}
/
>
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论