Browse Source

优化游戏端404显示问题

master
hanqin 3 weeks ago
parent
commit
cc1162b259
  1. 4
      Build_God_Game/src/api/index.ts

4
Build_God_Game/src/api/index.ts

@ -29,6 +29,10 @@ instance.interceptors.response.use(
} }
if (error.response?.status === 404) { if (error.response?.status === 404) {
window.location.href = "/404"; window.location.href = "/404";
return Promise.reject(error)
}
if (error.code === 'ERR_NETWORK' || error.code === 'ECONNABORTED' || !error.response) {
return Promise.reject(error)
} }
const responseData = error.response?.data; const responseData = error.response?.data;
if (typeof responseData === "string") { if (typeof responseData === "string") {

Loading…
Cancel
Save