yapi/client/reducer/middleware/messageMiddleware.js
System Administrator 362172ef52 fix: bug修复
2017-09-14 18:19:13 +08:00

12 lines
405 B
JavaScript
Executable File

import { message } from 'antd';
export default () => next => action => {
if(!action) return;
if (action.error) {
message.error((action.payload && action.payload.message) || '服务器错误');
} else if (action.payload && action.payload.data && action.payload.data.errcode && action.payload.data.errcode !== 40011) {
message.error(action.payload.data.errmsg);
}
return next(action);
};