當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript message.success方法代碼示例

本文整理匯總了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));
    }
  }
}
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:25,代碼來源:content.redux.ts

示例2:

 .then((resp: any) => {
   message.success('Add todo success');
   if (action.meta && action.meta.closeFn) {
     action.meta.closeFn();
   }
   return Actions.ADD_TODO.success(resp);
 })
開發者ID:A-Horse,項目名稱:bblist,代碼行數:7,代碼來源:todo.epic.ts

示例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);
   }
 });
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:9,代碼來源:upload.ts

示例4:

 res => {
     if (res.errno === 0) {
         message.success('評論設置更新成功');
         const comment = JSON.parse(window.SysConfig.options.comment);
         window.SysConfig.options.comment = JSON.stringify({
             'comment': comment
         });
     }
 }
開發者ID:75team,項目名稱:firekylin,代碼行數:9,代碼來源:comment.store.ts

示例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))
   }
 }
開發者ID:rui19921122,項目名稱:MeetingSystem,代碼行數:10,代碼來源:manage-check.ts

示例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)
     })
   }
 })
開發者ID:rui19921122,項目名稱:MeetingSystem,代碼行數:11,代碼來源:accident.ts

示例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("發生錯誤")
             }
         })
     }
     })
開發者ID:rui19921122,項目名稱:MeetingSystem,代碼行數:14,代碼來源:manage-check.ts

示例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...');
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:30,代碼來源:security.redux.ts

示例9:

 res => {
     if (res.errno === 0) {
         message.success('更新成功');
         window.SysConfig.options.push = data.push;
     }
 }
開發者ID:75team,項目名稱:firekylin,代碼行數:6,代碼來源:push.store.ts

示例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 }) {
開發者ID:danielwii,項目名稱:asuna-admin,代碼行數:30,代碼來源:models.redux.ts


注:本文中的antd.message.success方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。