修复跳转异常拦截问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use server'
|
||||
import {API_BASE_URL, ApiResponse, CLIENT_ID, CLIENT_SECRET} from '@/lib/api'
|
||||
import {add, isBefore} from 'date-fns'
|
||||
import {isRedirectError} from 'next/dist/client/components/redirect-error'
|
||||
import {cookies, headers} from 'next/headers'
|
||||
import {redirect} from 'next/navigation'
|
||||
import {cache} from 'react'
|
||||
@@ -169,6 +170,9 @@ async function call<R = undefined>(url: string, body: RequestInit['body'], auth?
|
||||
}
|
||||
catch (e) {
|
||||
console.error('后端请求失败', url, (e as Error).message)
|
||||
if (isRedirectError(e)) {
|
||||
throw e
|
||||
}
|
||||
throw new Error(`请求失败,网络错误`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user