From 67b9dc16d8853563eb41969eca68dfa1bbbbf2b9 Mon Sep 17 00:00:00 2001 From: "shengbin.ma" Date: Sat, 2 Nov 2024 21:05:07 +0800 Subject: [PATCH] feat(page): partner --- src/app/partner/page.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/app/partner/page.tsx diff --git a/src/app/partner/page.tsx b/src/app/partner/page.tsx new file mode 100644 index 0000000..c57af0a --- /dev/null +++ b/src/app/partner/page.tsx @@ -0,0 +1,25 @@ +/** + * 邀请 分享页 + */ +'use client'; + +import { useEffect } from 'react'; + +async function fetchSourece(source: string) { + if (!source) return; + const res = await fetch(`${process.env.NEXT_PUBLIC_HOST}/comment/visit/count/o2o?source=${source}`); + return res.json(); +} + +export default function Invite() { + useEffect(() => { + const searchParams = new URLSearchParams(window.location.search); + fetchSourece((searchParams as any)?.get('source')) + .then(() => {}) + .finally(() => { + window.location.replace('/'); + }); + }, []); + + return
; +}