当前位置: 首页>>代码示例>>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;未经允许,请勿转载。