forked from leancloud/ticket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathError.js
More file actions
39 lines (36 loc) · 1.05 KB
/
Error.js
File metadata and controls
39 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from 'react'
import PropTypes from 'prop-types'
export default function Error(props) {
if (!props.location.state) {
return (
<div>
<h1 className='font-logo'>这里是错误页面</h1>
<hr />
<p>不过好像没有抓到什么错误信息</p>
<p>如有疑问,可以通过 <a href="mailto:support@leancloud.cn">support@leancloud.cn</a> 联系我们</p>
</div>
)
}
let message
switch (props.location.state.code) {
case 'requireCustomerServiceAuth':
message = '您访问的页面需要技术支持人员权限。'
break
case 'Unauthorized':
message = '您没有权限访问该页面。'
break
default:
message = props.location.state.err.message
}
return (
<div>
<h1 className='font-logo'>很抱歉,看起来出了一些问题</h1>
<hr />
<p>{message}</p>
<p>如有疑问,可以通过 <a href="mailto:support@leancloud.cn">support@leancloud.cn</a> 联系我们</p>
</div>
)
}
Error.propTypes = {
location: PropTypes.object.isRequired
}