提交 ac8c12c8 编写于 作者: S Serge 提交者: 花裤衩

perf[request.js]: refine error reject (#2160)

上级 e8837d16
......@@ -48,7 +48,7 @@ service.interceptors.response.use(
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 20000) {
Message({
message: res.message || 'error',
message: res.message || 'Error',
type: 'error',
duration: 5 * 1000
})
......@@ -66,7 +66,7 @@ service.interceptors.response.use(
})
})
}
return Promise.reject(res.message || 'error')
return Promise.reject(new Error(res.message || 'Error'))
} else {
return res
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册