assistant-todo/src/app/page.tsx

31 lines
870 B
TypeScript
Raw Normal View History

2024-04-16 04:11:21 -04:00
'use client'
2025-07-30 06:43:37 -04:00
import {usePathname,useSearchParams, useRouter} from "next/navigation";
2024-05-28 06:54:58 -04:00
import dayjs from "dayjs";
import {useEffect} from "react";
2024-03-09 22:17:44 -05:00
export default function Home() {
2025-07-30 06:43:37 -04:00
const {replace} = useRouter();
const pathName = usePathname()
const searchParams = useSearchParams()
useEffect(()=>{
2025-07-30 06:43:37 -04:00
console.log({pathName},{searchParams})
2025-01-14 06:49:19 -05:00
if(localStorage.getItem('platform-security')){
2025-07-30 06:43:37 -04:00
if (!pathName){
var callBack = searchParams.get("callBack");
if (callBack){
replace(decodeURI(callBack))
}else {
replace("/task/project")
}
2025-01-14 06:49:19 -05:00
}
2025-01-16 06:10:45 -05:00
}else {
replace("/login")
2025-01-14 06:49:19 -05:00
}
},)
dayjs.locale('zh-cn')
return (
<main className="flex min-h-screen flex-col p-6">
</main>
);
2024-03-09 22:17:44 -05:00
}