This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
type ShallowRef
|
||||
} from 'vue'
|
||||
import { isAsyncTaskActive, isAsyncTaskTerminal, type AsyncTaskProgress } from '@/types/api'
|
||||
import { normalizeApiError } from '@/utils/business/apiError'
|
||||
|
||||
const POLL_DELAYS = [2000, 3000, 5000]
|
||||
const MAX_POLL_DELAY = 10000
|
||||
@@ -50,8 +51,7 @@ const writeStoredTaskId = (storageKey: string, taskId: number | null) => {
|
||||
}
|
||||
}
|
||||
|
||||
const getErrorMessage = (error: any) =>
|
||||
error?.response?.data?.msg || error?.message || '获取导出任务详情失败'
|
||||
const getErrorMessage = (error: unknown) => normalizeApiError(error).message
|
||||
|
||||
export function useAsyncTaskPolling<T extends AsyncTaskProgress>(
|
||||
options: AsyncTaskPollingOptions<T>
|
||||
|
||||
Reference in New Issue
Block a user