Commit 2070b8f8 by zhaochengxiang

弹框统一

parent b7bcf014
......@@ -3,7 +3,7 @@ import createSagaMiddleware from 'redux-saga'
import { all, call, takeLatest, takeEvery, cancelled } from 'redux-saga/effects'
import { SetSource, Cancel } from '../util/axios'
import { Connect, showMessage } from '../util';
import { Connect, showErrorNotifaction } from '../util';
import { reducers } from './reducer';
import * as user from './user';
import * as datasource from './datasource';
......@@ -23,7 +23,7 @@ function* request(args) {
yield call(callback, rs)
} catch (ex) {
if (ex) {
ex.ApiError && ex.ApiError.cnMessage && showMessage('error', ex.ApiError.cnMessage);
ex.ApiError && ex.ApiError.cnMessage && showErrorNotifaction('系统异常', ex.ApiError.cnMessage, 5);
error && error(ex);
}
}finally {
......
......@@ -124,6 +124,16 @@ export const showNotifaction = function(title, tip, duration=0) {
});
}
export const showErrorNotifaction = function(title, tip, duration=0) {
notification.config({ prefixCls: "yy-notification" });
notification.error({
message: title||'提示',
description: (typeof tip === 'string' ? (<span dangerouslySetInnerHTML={{ __html: tip||''}} />) : tip),
duration: duration,
});
}
export function generateList(data,dataList){
if(data[0]===undefined)
return data
......
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