How to use the antd.message.error function in antd

To help you get started, we’ve selected a few antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-redux-antd-es6 / react / app / reducers / common.js View on Github external
'receive staff'(state, action) {
    // eslint-disable-next-line no-unused-vars
    const { req, res } = action.payload
    if (hasResponseError(res)) {
      message.error(res.msg, 3)
      return { ...state, loading: false }
    }
    return { data: res, loading: false }
  },
}, staffResult())
github FleyX / bookmark / front / src / pages / userSpace / components / UserInfo / index.jsx View on Github external
async submit(itemKey, isShowKey) {
    if (this.state[itemKey] == null || this.state[itemKey] === "") {
      message.error("请修改后重试");
      return;
    }
    const { password, repeatPassword, actionId, email, username } = this.state;
    if (itemKey === "password" && password !== repeatPassword) {
      message.error("两次密码不一致");
      return;
    }
    if ((itemKey === "password" || itemKey === "email") && actionId == null) {
      message.warning("敏感操作,需校验密码");
      this.setState({
        isModelShow: true,
        currentAction: itemKey,
        currentShowKey: isShowKey
      });
      return;
    }
github helloyoucan / cmsys / src / routes / clubUnion / DataDownload / DataDownloadModal.js View on Github external
onChange: (info) => {
        /*if (info.file.status !== 'uploading') {
         console.log(info.file, info.fileList);
         }*/
        if (info.file.status === 'done') {
          if (typeof info.file.response == 'string') {
            message.success('上传成功');
            this.setState({
              formData: {
                ...this.state.formData,
                onlinePath: info.file.response,
                name: info.file.name
              }
            })
          } else {
            message.error(`上传失败`);
          }
        } else if (info.file.status === 'error') {
          message.error(`上传失败`);
        }

      },
    };
github breeze2 / breader / src / components / AppMenu.tsx View on Github external
.catch(() => {
        setIsUpdatingFeeds(false)
        Message.error(intl.formatMessage({ id: 'somethingWrong' }))
      })
  }
github Waiviogit / waivio / src / investarena / platform / umarkets.js View on Github external
parseOpenMarketOrderResult(result) {
    if (result.response === 'INSUFFICIENT_BALANCE') {
      this.dataDealToApi = null;
      message.error('Insufficient balance');
    } else if (result.response === 'NOT_TRADING_TIME') {
      this.dataDealToApi = null;
      message.error('Not trading time');
    }
  }
  static parseCloseMarketOrderResult(result) {
github wfh45678 / radar / webapp / src / component / field / modal / EditField.jsx View on Github external
(data) => {
					if (data.success) {
						message.success('修改成功');
					} else {
						message.error(data.msg);
					}
					this.setState({
						visible: false
					});
					this.props.reload();
				});
		}
github zenghongtu / Mob / src / renderer / pages / Listened / index.tsx View on Github external
const handleTrackTitleClick = (e) => {
    if (!albumUrl) {
      message.error('数据好像出了点问题,这个地方我们暂时去不了 😭');
      e.preventDefault();
    }
  };
  return (
github edp963 / davinci / webapp / share / containers / Dashboard / index.tsx View on Github external
private initiateWidgetDownloadTask = (itemId: number, widgetId: number) => {
    const { widgets } = this.props
    const widget = widgets.find((w) => w.id === widgetId)
    const queryConditions: Partial = {
      nativeQuery: false
    }
    try {
      const widgetProps: IWidgetProps = JSON.parse(widget.config)
      const { mode, selectedChart, chartStyles } = widgetProps
      if (mode === 'chart' && selectedChart === getTable().id) {
        queryConditions.nativeQuery = chartStyles.table.withNoAggregators
      }
    } catch (error) {
      message.error(error)
    }
    this.getData(
      (renderType, itemId, dataToken, requestParams) => {
        const downloadParams = [{
          ...requestParams,
          id: widgetId
        }]
        this.props.onInitiateDownloadTask(this.shareClientId, dataToken, DownloadTypes.Widget, downloadParams, itemId)
      },
      'rerender',
      itemId,
      widgetId,
      queryConditions
    )
  }
github creatorsdaily / client.creatorsdaily.com / pages / settings / profile.js View on Github external
onError: error => {
      const { form } = ref.current.props
      const errors = formError(form, error)
      message.error(errors[0].message)
    }
  })
github chrztoph / texterify / app / javascript / components / sites / dashboard / ProjectsSite.tsx View on Github external
onError: (_errors: any) => {
              message.error("Failed to create project.");
            }
          }}