本文整理汇总了TypeScript中antd.message.success方法的典型用法代码示例。如果您正苦于以下问题:TypeScript message.success方法的具体用法?TypeScript message.success怎么用?TypeScript message.success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类antd.message
的用法示例。
在下文中一共展示了message.success方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loadModels
function* loadModels({ payload: { name, models } }: LoadModelsParams) {
const { token } = yield select((state: RootState) => state.auth);
if (token) {
try {
const {
[name]: { extras },
} = models;
logger.debug('[loadModels]', 'loading content', { name, extras });
message.loading(`loading content '${name}'...`);
const response = yield call(AppContext.adapters.models.loadModels, name, extras);
message.success(`load content '${name}' success`);
logger.log('[loadModels]', 'loaded content', { name, response });
yield put(
contentActions.loadModelsSuccess({
[name]: { data: response.data, loading: false },
}),
);
} catch (e) {
logger.warn('[loadModels]', { e });
message.error(toErrorMessage(e));
}
}
}
示例2:
.then((resp: any) => {
message.success('Add todo success');
if (action.meta && action.meta.closeFn) {
action.meta.closeFn();
}
return Actions.ADD_TODO.success(resp);
})
示例3: Promise
return new Promise((resolve, reject) => {
if (/^20\d$/.test(response.status as any)) {
message.success('upload successfully.');
resolve(response.data);
} else {
message.error('upload failed.');
reject(response);
}
});
示例4:
res => {
if (res.errno === 0) {
message.success('评论设置更新成功');
const comment = JSON.parse(window.SysConfig.options.comment);
window.SysConfig.options.comment = JSON.stringify({
'comment': comment
});
}
}
示例5: getState
}).then(response => {
if (response.status != 202) {
message.error("替换失败")
} else {
let state = getState();
dispatch(GetData((state.manage_check as manage_check_store).selectDate, (state.manage_check as manage_check_store).selectClassName));
message.success("替换成功");
dispatch(showModal(false))
}
}
示例6: dispatch
method: 'delete', headers: {"Content-Type": 'application/json'}}).then(response => {
if (response.status >= 200 && response.status < 300) {
message.success('删除成功');
dispatch(get_unlearn_department_accident())
} else {
response.json().then(json => {
message.error('提交失败,错误码为' + response.status);
console.log(json)
})
}
})
示例7: dispatch
}).then(response => {
if (response.status == 200) {
message.success("成功更改了密码")
dispatch(actions.change_password_modal(false))
} else {
response.json().then(json => {
try {
message.error("错误," + json['error'])
}catch(e){
message.error("发生错误")
}
})
}
})
示例8: select
// --------------------------------------------------------------
// Module sagas
// function* actionSage(args) {
// yield call; yield put({ type: actionType, payload: {} })
// }
// --------------------------------------------------------------
const securitySagaFunctions = {
*loadAllRoles() {
const { token } = yield select((state: RootState) => state.auth);
if (token) {
message.loading('loading all roles...');
try {
const response = yield call(securityProxy.roles);
message.success('load all roles success!');
logger.log('[loadAllRoles]', 'response of load all roles is', response);
yield put(securityActions.loadAllRolesSuccess(response.data));
} catch (e) {
logger.warn('[loadAllRoles]', 'CATCH -> load all roles error', e);
message.error(toErrorMessage(e));
}
}
},
*getCurrentUser() {
const { token } = yield select((state: RootState) => state.auth);
if (token) {
message.loading('loading current user...');
try {
logger.log('[getCurrentUser]', 'get current user after rehydrate...');
示例9:
res => {
if (res.errno === 0) {
message.success('更新成功');
window.SysConfig.options.push = data.push;
}
}
示例10: select
// --------------------------------------------------------------
// Module sagas
// function* actionSage(args) {
// yield call; yield puy({ type: actionType, payload: {} })
// }
// --------------------------------------------------------------
const modelsSagaFunctions = {
*fetch({ payload: { modelName, data }, callback }) {
const { token } = yield select((state: RootState) => state.auth);
if (token) {
message.loading(`loading model '${modelName}'...`);
try {
const response = yield call(AppContext.adapters.models.fetch, modelName, data);
message.success(`load model '${modelName}' success!`);
logger.log('[fetch]', 'response of load model is', response);
safeCallback(callback, { response });
yield put(modelsActions.fetchSuccess(modelName, response.data));
} catch (e) {
logger.warn('[fetch]', e, { e });
safeCallback(callback, { error: e });
message.error(toErrorMessage(e));
}
}
},
/**
* refresh models after model upsert in event bus
*/
*upsert({ payload: { modelName, data }, callback }) {