import { DOMAttributes, ReactNode } from "react"; import { useParams } from "react-router-dom"; import PaymentSuccess from "./PaymentSuccess"; import GithubCallback, { GithubLoginSource } from "./GithubCallback"; const StyledWrapper = ({ children }: DOMAttributes & { children?: ReactNode }) => { return
{children}
; }; // type Props = { // type: "payment_success"; // }; // 该页面服务于一些第三方服务的回调,比如stripe付款成功的回调,GitHub登录成功的回调 export default function CallbackPage() { const { type = "", payload = "" } = useParams(); // stripe 付款成功 if (type == "payment_success") { return ( ); } // github授权成功 if (type == "github") { const query = new URLSearchParams(location.search); const code = query.get("code") ?? ""; return ( ); } return callback page; }