本文整理匯總了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);
}