'use client' import {usePathname,useSearchParams, useRouter} from "next/navigation"; import dayjs from "dayjs"; import {useEffect} from "react"; export default function Home() { const {replace} = useRouter(); useEffect(()=>{ const pathName = usePathname() const searchParams = useSearchParams() console.log({pathName},{searchParams}) if(localStorage.getItem('platform-security')){ if (!pathName){ var callBack = searchParams.get("callBack"); if (callBack){ replace(decodeURI(callBack)) }else { replace("/task/project") } } }else { replace("/login") } },[]) dayjs.locale('zh-cn') return (
); }