mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
fix: 修改不返回 code 导致的问题
This commit is contained in:
parent
2a8d0717f8
commit
a400526108
@ -21,7 +21,7 @@ axiosInstance.interceptors.request.use(
|
|||||||
axiosInstance.interceptors.response.use(
|
axiosInstance.interceptors.response.use(
|
||||||
(res: AxiosResponse) => {
|
(res: AxiosResponse) => {
|
||||||
const { code } = res.data as { code: number }
|
const { code } = res.data as { code: number }
|
||||||
if (code === undefined || code === null) return Promise.resolve(res)
|
if (code === undefined || code === null) return Promise.resolve(res.data)
|
||||||
if (code === ResultEnum.DATA_SUCCESS) return Promise.resolve(res.data)
|
if (code === ResultEnum.DATA_SUCCESS) return Promise.resolve(res.data)
|
||||||
// 重定向
|
// 重定向
|
||||||
if (ErrorPageNameMap.get(code)) redirectErrorPage(code)
|
if (ErrorPageNameMap.get(code)) redirectErrorPage(code)
|
||||||
|
@ -132,7 +132,7 @@ const sendHandle = async () => {
|
|||||||
if (res) {
|
if (res) {
|
||||||
const { data } = res
|
const { data } = res
|
||||||
if (!data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!')
|
if (!data && !targetData.value.filter) window['$message'].warning('您的数据不符合默认格式,请配置过滤器!')
|
||||||
targetData.value.option.dataset = newFunctionHandle(data.data, data, targetData.value.filter)
|
targetData.value.option.dataset = newFunctionHandle(data, res, targetData.value.filter)
|
||||||
showMatching.value = true
|
showMatching.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ const fetchTargetData = async () => {
|
|||||||
try {
|
try {
|
||||||
const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig))
|
const res = await customizeHttp(toRaw(targetData.value.request), toRaw(chartEditStore.getRequestGlobalConfig))
|
||||||
if (res) {
|
if (res) {
|
||||||
sourceData.value = res.data
|
sourceData.value = res
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
window['$message'].warning('没有拿到返回值,请检查接口!')
|
window['$message'].warning('没有拿到返回值,请检查接口!')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user