Skip to content

Commit

Permalink
fix(bug): 修复网络错误情况下axios bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Sep 15, 2020
1 parent ddd31df commit c029395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ service.interceptors.response.use(
// http状态码200以外的情况
// 请检查网络链接或联系管理员
const msg = '请检查网络链接或联系管理员。';
MessageBox.alert(`${error.response.data.message}${msg}`, '网络异常', {
MessageBox.alert(`${(error.response && error.response.data.message) || error.message}${msg}`, '网络异常', {
confirmButtonText: '重试',
type: 'warning',
});
Expand Down

0 comments on commit c029395

Please sign in to comment.