Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
马旭烽
jinfa-platform
Commits
7ef9f012
Commit
7ef9f012
authored
Jun 19, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加404 500页面
parent
9d767d1e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
118 additions
and
6 deletions
+118
-6
config.ts
config/config.ts
+1
-2
proxy.ts
config/proxy.ts
+1
-1
router.ts
config/router.ts
+10
-1
Artwork.png
mockStatic/Artwork.png
+0
-0
illus.png
mockStatic/illus.png
+0
-0
404.tsx
src/pages/404.tsx
+43
-0
500.tsx
src/pages/500.tsx
+43
-0
index.less
src/pages/index.less
+18
-0
index.less
src/pages/user/index.less
+1
-1
register.tsx
src/pages/user/register.tsx
+1
-1
No files found.
config/config.ts
View file @
7ef9f012
...
...
@@ -72,4 +72,4 @@ export default defineConfig({
* 配置主题,实际上是配 less 变量。
*/
theme
,
});
\ No newline at end of file
});
config/proxy.ts
View file @
7ef9f012
export
default
{
'/api'
:
{
'target'
:
'http://10.0.0.
129
:8100/'
,
'target'
:
'http://10.0.0.
25
:8100/'
,
'changeOrigin'
:
true
,
'pathRewrite'
:
{
'^/api'
:
''
},
}
...
...
config/router.ts
View file @
7ef9f012
...
...
@@ -24,7 +24,15 @@ const router = [
component
:
'@/pages/user/policy'
},
]
}
},
{
path
:
'/404'
,
component
:
'@/pages/404'
,
},
{
path
:
'/500'
,
component
:
'@/pages/500'
,
},
]
export
default
router
\ No newline at end of file
mockStatic/Artwork.png
0 → 100644
View file @
7ef9f012
75.5 KB
mockStatic/illus.png
0 → 100644
View file @
7ef9f012
167 KB
src/pages/404.tsx
0 → 100644
View file @
7ef9f012
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Row
,
Col
}
from
'antd'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
UserHeader
from
'../layouts/components/UserHeader'
;
import
styles
from
'./index.less'
import
Img
from
'../../mockStatic/illus.png'
const
NoFoundPage
:
React
.
FC
<
{}
>
=
()
=>
{
const
handleReturn
=
()
=>
{
history
.
go
(
-
1
)
}
return
(
<
div
className=
{
styles
.
wrapper
}
>
<
UserHeader
logo=
{
GlobalConfig
.
global
.
logo
}
/>
<
div
className=
{
styles
.
errorBox
}
>
<
Row
>
<
Col
span=
{
12
}
>
<
div
className=
{
styles
.
desc
}
>
<
h1
>
哎呀!页面未找到
</
h1
>
<
h4
>
该错误可能由于如下原因所致:
</
h4
>
<
p
>
·页面已失效
</
p
>
<
p
>
·页面已修改或者删除
</
p
>
<
Button
type=
"primary"
size=
"large"
style=
{
{
marginTop
:
100
}
}
onClick=
{
handleReturn
}
>
返回到主页
</
Button
>
</
div
>
</
Col
>
<
Col
span=
{
12
}
>
<
img
className=
{
styles
.
image
}
src=
{
Img
}
alt=
"数商云服务"
/>
</
Col
>
</
Row
>
</
div
>
</
div
>
)
}
export
default
NoFoundPage
;
src/pages/500.tsx
0 → 100644
View file @
7ef9f012
import
React
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Button
,
Row
,
Col
}
from
'antd'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
UserHeader
from
'../layouts/components/UserHeader'
;
import
styles
from
'./index.less'
import
Img
from
'../../mockStatic/Artwork.png'
const
InternetError
:
React
.
FC
<
{}
>
=
()
=>
{
const
handleReload
=
()
=>
{
history
.
go
(
-
1
)
}
return
(
<
div
className=
{
styles
.
wrapper
}
>
<
UserHeader
logo=
{
GlobalConfig
.
global
.
logo
}
/>
<
div
className=
{
styles
.
errorBox
}
>
<
Row
>
<
Col
span=
{
12
}
>
<
div
className=
{
styles
.
desc
}
>
<
h1
>
哎呀!网络连接出错了
</
h1
>
<
h4
>
该错误可能由于如下原因所致:
</
h4
>
<
p
>
·电脑未连接到网络
</
p
>
<
p
>
·防火墙或杀毒软件阻止
</
p
>
<
Button
type=
"primary"
size=
"large"
style=
{
{
marginTop
:
100
}
}
onClick=
{
handleReload
}
>
刷新页面试试
</
Button
>
</
div
>
</
Col
>
<
Col
span=
{
12
}
>
<
img
className=
{
styles
.
image
}
src=
{
Img
}
alt=
"数商云服务"
/>
</
Col
>
</
Row
>
</
div
>
</
div
>
)
}
export
default
InternetError
;
src/pages/index.less
View file @
7ef9f012
.normal {
}
.title {
font-size: 24px;
color: #666;
}
// 500 error
// .wrapper{
// }
.errorBox{
width: 100%;
.desc{
width: 400px;
margin: 200px auto 0;
}
.image {
display: block;
width: 100%;
height: 100%;
}
}
src/pages/user/index.less
View file @
7ef9f012
...
...
@@ -124,7 +124,7 @@
}
.formBoxStep1 {
width: 32
0
px;
width: 32
4
px;
.make-center-space(margin, 40, 0);
}
...
...
src/pages/user/register.tsx
View file @
7ef9f012
...
...
@@ -380,7 +380,7 @@ const UserRegistry = () => {
useEffect
(()
=>
{
if
(
time
===
0
){
clearInterval
(
timeChange
)
setTime
(
5
)
setTime
(
60
)
history
.
push
(
'/user/login'
)
console
.
log
(
'执行登录跳转!'
)
}
...
...
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