'use client'
import {usePathname,useSearchParams, useRouter} from "next/navigation";
import dayjs from "dayjs";
import {useEffect} from "react";
export default function Home() {

    const {replace} = useRouter();
    const pathName = usePathname()
    const searchParams = useSearchParams()
    useEffect(()=>{
        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 (
        <main className="flex min-h-screen flex-col p-6">
        </main>
    );
}
