diff --git a/src/components/DenseFramework.vue b/src/components/DenseFramework.vue index d85407c..2d45584 100644 --- a/src/components/DenseFramework.vue +++ b/src/components/DenseFramework.vue @@ -26,9 +26,19 @@ const urlRef = computed(() => { return props.imageQuery }) -const { onFetchResponse, onFetchError, isFetching, execute } = baseFetch( +const { onFetchResponse, isFetching, execute } = baseFetch( urlRef, - { immediate: false }, + { immediate: false, updateDataOnError: true, onFetchError: async ({ error, data, response }) => { + // same as afterFetch + imageResult.result = 'error' + const rawErrorMsg = (await response?.json()).error.message as string ?? '未知错误' + if (rawErrorMsg.includes('Improper input')) { + imageResult.message = '数据异常,无法拟合. 请使用其他时间段再试' + return { error, data } + } + imageResult.message = rawErrorMsg ?? '未知错误' + return { error, data } + } }, ) watch(isFetching, (fetching) => { if (fetching) { @@ -51,11 +61,6 @@ onFetchResponse(async (resp) => { } }) -onFetchError(async (error) => { - imageResult.result = 'error' - imageResult.message = error -}) - function download() { if (imageResult.result === 'success') { const a = document.createElement('a') diff --git a/src/components/dense/saber/plot_wave_fitting.vue b/src/components/dense/saber/plot_wave_fitting.vue index 8daca8f..8b39037 100644 --- a/src/components/dense/saber/plot_wave_fitting.vue +++ b/src/components/dense/saber/plot_wave_fitting.vue @@ -33,7 +33,7 @@ const urll = computed(() => { query.set('path', selected.path) query.set('day', selected.day) query.set('height_no', selected.height_no.toString()) - query.set('lat_ranges', selected.lat_ranges) + query.set('lat_range', selected.lat_ranges) return `/saber/render/gravity_wave/per_day/wave_fitting?${query}` })