本文整理汇总了TypeScript中antd.message.info方法的典型用法代码示例。如果您正苦于以下问题:TypeScript message.info方法的具体用法?TypeScript message.info怎么用?TypeScript message.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类antd.message
的用法示例。
在下文中一共展示了message.info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: loginSaga
function* loginSaga({ payload: { username, password }, callback }) {
const auth: AuthState = yield select((state: RootState) => state.auth);
try {
const response = yield call(authProxy.login, username, password);
logger.log('[loginSaga]', 'response is', response);
// 切换用户时更新操作区域,如果未来需要保存当前页面配置的话,应该将切换操作提出为单独的 Saga
if (auth.username !== username) {
yield put(panesActions.closeAll());
}
if (callback) callback({ response });
const token = yield call(authProxy.extractToken, response.data);
yield put(authActions.loginSuccess(username, token));
message.info(`'${username}' login success`);
yield put(routerActions.toIndex());
} catch (error) {
logger.error('[loginSaga]', { error });
try {
if (callback != null) callback({ error });
} catch (e) {
logger.warn('[upsert] callback error', e, { e });
}
if (error.response) {
yield put(authActions.loginFailed(error.response));
message.error(toErrorMessage(error));
}
}
}
示例2: put
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 }) {
const { token } = yield select((state: RootState) => state.auth);
if (token) {
message.info(`upsert model '${modelName}'...`);
try {
const response = yield call(AppContext.adapters.models.upsert, modelName, data);
message.success(`upsert model '${modelName}' success!`);
logger.log('[upsert]', 'response of upsert model is', response);
if (callback != null) callback({ response });
// save model data when upsert is success
yield put(modelsActions.fetchSuccess(modelName, response.data));
} catch (error) {
logger.warn('[upsert]', error, { error });
try {
if (callback != null) callback({ error });
} catch (e) {
logger.warn('[upsert] callback error', e, { e });
}
示例3:
export const info=(messageInfo:string)=>{
message.info(messageInfo);
}