diff --git a/src/app/admin/clients.tsx b/src/app/admin/clients.tsx index 2069fee..ad67880 100644 --- a/src/app/admin/clients.tsx +++ b/src/app/admin/clients.tsx @@ -105,23 +105,21 @@ export function Header() { theme="ghost" className="w-9 h-9 ml-4 md:ml-0" onClick={toggleNavbar}> - {navbar - ? - : - } + {navbar ? : } - - 欢迎来到,蓝狐代理 - + 欢迎来到,蓝狐代理 +
+ + + 实名认证 +
- {/* right */} -
- +
+ 返回首页 @@ -176,7 +174,7 @@ export function Navbar() { } label="账户总览" expand={navbar}/> - } label="实名认证" expand={navbar}/> + {/* } label="实名认证" expand={navbar}/> */} } label="白名单" expand={navbar}/> } label="购买套餐" expand={navbar}/> } label="提取 IP" expand={navbar}/> diff --git a/src/components/composites/extract/index.tsx b/src/components/composites/extract/index.tsx index 61f4fa7..fd57349 100644 --- a/src/components/composites/extract/index.tsx +++ b/src/components/composites/extract/index.tsx @@ -9,7 +9,7 @@ import {Button} from '@/components/ui/button' import {useForm, useFormContext, useWatch} from 'react-hook-form' import {Alert, AlertTitle} from '@/components/ui/alert' import {ArrowRight, Box, CircleAlert, CopyIcon, ExternalLinkIcon, LinkIcon, Loader, Plus, Timer} from 'lucide-react' -import {memo, ReactNode, useEffect, useRef, useState} from 'react' +import {memo, ReactNode, Suspense, use, useEffect, useRef, useState} from 'react' import {useStatus} from '@/lib/states' import {allResource} from '@/actions/resource' import {Resource} from '@/lib/models' @@ -113,7 +113,9 @@ const FormFields = memo(() => { return (
{/* 选择套餐 */} - + + + {/* 地区筛选 */} @@ -332,8 +334,13 @@ FormFields.displayName = 'FormFields' function SelectResource() { const [resources, setResources] = useState([]) const [status, setStatus] = useStatus() - const profile = useProfileStore(state => state.profile) + const profile = use(useProfileStore(store => store.profile)) const getResources = async () => { + if (!profile) { + setStatus('done') + setResources([]) + return + } setStatus('load') try { const resp = await allResource() @@ -352,7 +359,7 @@ function SelectResource() { useEffect(() => { getResources().then() // eslint-disable-next-line react-hooks/exhaustive-deps - }, []) + }, [profile]) return ( @@ -372,8 +379,8 @@ function SelectResource() {
) : !profile ? (
- - 请先登录账号,去登录 + {/* */} + 请先登录账号,去登录
) : resources.length === 0 ? (