monorepo packages (#344)

This commit is contained in:
Archer
2023-09-24 18:02:09 +08:00
committed by GitHub
parent a4ff5a3f73
commit 3d7178d06f
535 changed files with 12048 additions and 227 deletions

View File

@@ -0,0 +1,46 @@
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { serviceSideProps } from '@/utils/web/i18n';
import { useGlobalStore } from '@/store/global';
import { addLog } from '@/service/utils/tools';
import { getErrText } from '@/utils/tools';
function Error() {
const router = useRouter();
const { lastRoute } = useGlobalStore();
useEffect(() => {
setTimeout(() => {
window.umami?.track('pageError', {
userAgent: navigator.userAgent,
platform: navigator.platform,
appName: navigator.appName,
lastRoute,
route: router.asPath
});
}, 1000);
setTimeout(() => {
router.back();
}, 2000);
}, []);
return (
<p>
safari chrome
</p>
);
}
export async function getServerSideProps(context: any) {
console.log('[render error]: ', context);
addLog.error(getErrText(context?.res));
return {
props: { ...(await serviceSideProps(context)) }
};
}
export default Error;