Commit cad9acb7 authored by 前端-许佳敏's avatar 前端-许佳敏

全局接口错误提示

parent 13d21ecd
...@@ -91,8 +91,10 @@ class ApiRequest { ...@@ -91,8 +91,10 @@ class ApiRequest {
baseRequest<IRequestSuccess<T>>(url, options).then(res => { baseRequest<IRequestSuccess<T>>(url, options).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
options.ctlType === 'message' && message.success(res.message) options.ctlType === 'message' && message.success(res.message)
}
resolve(res) resolve(res)
} else {
message.error(res.message)
}
}).catch((err: IRequestError) => { }).catch((err: IRequestError) => {
// http错误处理, 直接透传 // http错误处理, 直接透传
reject(err) reject(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment