Browse Source
docs: Report 404 for monitor (#40278)
* docs: monitor 404 report
* docs: Add source
* docs: patch
* docs: clean up
pull/40289/head
二货爱吃白萝卜
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
2 deletions
-
.dumi/pages/404/index.tsx
|
|
@ -1,7 +1,7 @@ |
|
|
|
import React, { useEffect } from 'react'; |
|
|
|
import { Result, Button } from 'antd'; |
|
|
|
import { HomeOutlined } from '@ant-design/icons'; |
|
|
|
import { Button, Result } from 'antd'; |
|
|
|
import { Link, useLocation } from 'dumi'; |
|
|
|
import React, { useEffect } from 'react'; |
|
|
|
import * as utils from '../../theme/utils'; |
|
|
|
|
|
|
|
export interface NotFoundProps { |
|
|
@ -29,6 +29,15 @@ const NotFoundPage: React.FC<NotFoundProps> = ({ router }) => { |
|
|
|
router.replace(utils.getLocalizedPathname(`/${DIRECT_MAP[matchPath]}`, isZhCN).pathname); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Report if necessary
|
|
|
|
const { yuyanMonitor } = window as any; |
|
|
|
if (yuyanMonitor) { |
|
|
|
yuyanMonitor.log({ |
|
|
|
code: 11, |
|
|
|
msg: `Page not found: ${location.href}; Source: ${document.referrer}`, |
|
|
|
}); |
|
|
|
} |
|
|
|
}, []); |
|
|
|
|
|
|
|
return ( |
|
|
|