mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
docs: Report 404 for monitor (#40278)
* docs: monitor 404 report * docs: Add source * docs: patch * docs: clean up
This commit is contained in:
parent
a713bf7978
commit
7276438486
@ -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 (
|
||||
|
Loading…
Reference in New Issue
Block a user