mirror of
https://github.com/langgenius/dify.git
synced 2026-07-30 00:39:34 +08:00
27 lines
930 B
TypeScript
27 lines
930 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
import { FullScreenLoading } from '@/app/components/full-screen-loading'
|
|
import EducationApplyPage from '@/app/education-apply/education-apply-page'
|
|
import { useProviderContext } from '@/context/provider-context'
|
|
import { useRouter, useSearchParams } from '@/next/navigation'
|
|
|
|
export default function EducationApply() {
|
|
const router = useRouter()
|
|
const { enableEducationPlan, isFetchedPlanInfo, isLoadingEducationAccountInfo } =
|
|
useProviderContext()
|
|
const searchParams = useSearchParams()
|
|
const token = searchParams.get('token')
|
|
|
|
useEffect(() => {
|
|
if (!isFetchedPlanInfo) return
|
|
|
|
if (!enableEducationPlan || !token) router.replace('/')
|
|
}, [enableEducationPlan, isFetchedPlanInfo, router, token])
|
|
|
|
if (!isFetchedPlanInfo || !enableEducationPlan || !token || isLoadingEducationAccountInfo)
|
|
return <FullScreenLoading />
|
|
|
|
return <EducationApplyPage />
|
|
}
|