"use client";

import React, { useEffect } from "react";
import { useRouter } from "next/navigation";

export default function JsApi({ params }) {
  const router = useRouter();
  useEffect(() => {
    const redirect_uri = `https://tiefen.fun/pay/inweixin/${encodeURIComponent(
      params.body
    )}`;
    router.replace(
      `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc28fd8aaf31984b6&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
    );
  }, []);
  return <section>JsApi</section>;
}
