From a48641fe7c2ba0182f2507d9463148d7fe4d9103 Mon Sep 17 00:00:00 2001 From: al Date: Mon, 12 Aug 2024 18:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0test=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/test/page.js | 13 +++++++++++++ components/WithAuth/index.js | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 app/test/page.js diff --git a/app/test/page.js b/app/test/page.js new file mode 100644 index 0000000..ffd7bca --- /dev/null +++ b/app/test/page.js @@ -0,0 +1,13 @@ +"use client"; + +import React, { useEffect } from "react"; +import { useRouter } from "next/navigation"; + +export default function WxpayH5({ params }) { + const router = useRouter(); + useEffect(() => { + const redirect_uri = decodeURIComponent(params.url); + router.replace(redirect_uri); + }, []); + return
; +} \ No newline at end of file diff --git a/components/WithAuth/index.js b/components/WithAuth/index.js index 681fe1e..7e1f19f 100644 --- a/components/WithAuth/index.js +++ b/components/WithAuth/index.js @@ -23,6 +23,9 @@ export default function WithAuth(WrappedComponent) { const checkLogin = async () => { const hasToken = await get("token"); // console.log("hasToken", hasToken); + if(pathname.includes("test")){ + return + } if (hasToken) { const currentIsLogin = await checkAuth(); if (!currentIsLogin) {