更新 src/api/axios.ts

修改
This commit is contained in:
mkm 2023-09-15 19:43:10 +08:00
parent d530c65350
commit 3334335592

View File

@ -51,6 +51,9 @@ axiosInstance.interceptors.response.use(
return Promise.resolve(res.data)
}
const { code } = res.data as { code: number }
const responseData = res as AxiosResponse<any>
const { code } = responseData.data as { code: number }
if (code === undefined || code === null) return Promise.resolve(res.data)