feat: error track, app scroll

This commit is contained in:
archer
2023-09-03 17:37:14 +08:00
parent 7c16d08ec0
commit e0b23a26f2
9 changed files with 101 additions and 40 deletions

View File

@@ -1,10 +1,19 @@
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { serviceSideProps } from '@/utils/i18n';
function Error() {
const router = useRouter();
useEffect(() => {
setTimeout(() => {
router.replace('/app/list');
window.umami?.track('pageError', {
userAgent: navigator.userAgent,
platform: navigator.platform,
appName: navigator.appName
});
}, 1000);
setTimeout(() => {
router.back();
}, 2000);
}, []);
@@ -16,4 +25,12 @@ function Error() {
);
}
export async function getServerSideProps(context: any) {
console.log(context);
return {
props: { ...(await serviceSideProps(context)) }
};
}
export default Error;