重构鉴权逻辑,新增中间件刷新令牌,授权接口统一后处理无授权跳转
This commit is contained in:
@@ -19,8 +19,8 @@ import {zodResolver} from '@hookform/resolvers/zod'
|
||||
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/auth'
|
||||
import {login} from '@/actions/auth'
|
||||
import {sendSMS} from '@/actions/verify'
|
||||
import {useRouter, useSearchParams} from 'next/navigation'
|
||||
import {toast} from 'sonner'
|
||||
import {ApiResponse} from '@/lib/api'
|
||||
@@ -83,7 +83,7 @@ export default function LoginPage(props: LoginPageProps) {
|
||||
// 发送验证码
|
||||
let resp: ApiResponse
|
||||
try {
|
||||
resp = await verify({
|
||||
resp = await sendSMS({
|
||||
phone: username,
|
||||
captcha: captchaCode,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user