测试微信支付

This commit is contained in:
yezian 2024-02-20 15:24:22 +08:00
parent 6c2743a2bf
commit 8ceb34ce5d
1 changed files with 19 additions and 1 deletions

View File

@ -7,7 +7,7 @@ export default function SafePay({ params }) {
const router = useRouter(); const router = useRouter();
useEffect(() => { useEffect(() => {
const weixinUrl = decodeURIComponent(params.weixin); const weixinUrl = decodeURIComponent(params.weixin);
router.push(weixinUrl); router.replace(weixinUrl);
}, []); }, []);
return ( return (
@ -27,6 +27,24 @@ export default function SafePay({ params }) {
</svg> </svg>
<p className="text-sm text-[#5fc157]">正在跳转...</p> <p className="text-sm text-[#5fc157]">正在跳转...</p>
</div> </div>
<button
className="bg-red-100 p-2"
onClick={() => router.push(decodeURIComponent(params.weixin))}
>
push
</button>
<button
className="bg-red-200 p-2"
onClick={() => router.replace(decodeURIComponent(params.weixin))}
>
replace
</button>
<button
className="bg-red-300 p-2"
onClick={() => window.open(decodeURIComponent(params.weixin))}
>
window
</button>
</section> </section>
); );
} }