完善产品购买页面,抽取公共组件,优化导航链接
This commit is contained in:
BIN
src/app/(auth)/login/_assets/bg.webp
Normal file
BIN
src/app/(auth)/login/_assets/bg.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -1,11 +1,10 @@
|
||||
'use client'
|
||||
import {useState, useCallback, useRef} from 'react'
|
||||
import {useState, useCallback, useRef, useContext} from 'react'
|
||||
import {Input} from '@/components/ui/input'
|
||||
import {Button} from '@/components/ui/button'
|
||||
import {Checkbox} from '@/components/ui/checkbox'
|
||||
import {merge} from '@/lib/utils'
|
||||
import Image from 'next/image'
|
||||
import logo from '@/assets/logo.webp'
|
||||
import {
|
||||
Card,
|
||||
CardHeader,
|
||||
@@ -21,11 +20,13 @@ import {useForm} from 'react-hook-form'
|
||||
import zod from 'zod'
|
||||
import Captcha from './captcha'
|
||||
import verify from '@/actions/auth/verify'
|
||||
import {login} from '@/actions/auth/login'
|
||||
import {login} from '@/actions/auth/auth'
|
||||
import {useRouter} from 'next/navigation'
|
||||
import {toast} from 'sonner'
|
||||
import {ApiResponse} from '@/lib/api'
|
||||
import {Label} from '@/components/ui/label'
|
||||
import logo from '@/assets/logo.webp'
|
||||
import bg from './_assets/bg.webp'
|
||||
|
||||
export type LoginPageProps = {}
|
||||
|
||||
@@ -162,7 +163,7 @@ export default function LoginPage(props: LoginPageProps) {
|
||||
|
||||
if (result.success) {
|
||||
// 登录成功
|
||||
toast.success('登陆成功', {
|
||||
toast.success('登录成功', {
|
||||
description: '欢迎回来!',
|
||||
})
|
||||
|
||||
@@ -190,10 +191,12 @@ export default function LoginPage(props: LoginPageProps) {
|
||||
return (
|
||||
<main className={merge(
|
||||
`relative`,
|
||||
`h-screen w-screen xl:pr-64 bg-[url(/login/bg.webp)] bg-cover bg-left`,
|
||||
`h-screen w-screen xl:pr-64 bg-cover bg-left`,
|
||||
`flex justify-center xl:justify-end items-center`,
|
||||
)}>
|
||||
<Image src={logo} alt={`logo`} height={64} className={`absolute top-8 left-8`}/>
|
||||
<Image src={bg} alt={`背景图`} fill priority className={`absolute -z-10 object-cover`}/>
|
||||
|
||||
<Image src={logo} alt={`logo`} priority height={64} className={`absolute top-8 left-8`}/>
|
||||
|
||||
{/* 登录表单 */}
|
||||
<Card className="w-96 mx-4 shadow-lg">
|
||||
|
||||
Reference in New Issue
Block a user