Skip to content

Commit

Permalink
✨ 添加网络请求失败提醒 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier authored Feb 7, 2025
1 parent 3403a5e commit f527034
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ axios.interceptors.response.use(
return success.data
},
(error) => {
if (!error) {
Message.error({ message: "网络连接好像不通畅哦..." })
if (error.request) {
Message.error({
message: "网络连接好像不通畅哦,请检查服务器与地址设置...",
})
return
}
const { status, data } = error.response
Expand Down

0 comments on commit f527034

Please sign in to comment.