Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'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())
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;
}
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(`上传失败`);
}
},
};
.catch(() => {
setIsUpdatingFeeds(false)
Message.error(intl.formatMessage({ id: 'somethingWrong' }))
})
}
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) {
(data) => {
if (data.success) {
message.success('修改成功');
} else {
message.error(data.msg);
}
this.setState({
visible: false
});
this.props.reload();
});
}
const handleTrackTitleClick = (e) => {
if (!albumUrl) {
message.error('数据好像出了点问题,这个地方我们暂时去不了 😭');
e.preventDefault();
}
};
return (
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
)
}
onError: error => {
const { form } = ref.current.props
const errors = formError(form, error)
message.error(errors[0].message)
}
})
onError: (_errors: any) => {
message.error("Failed to create project.");
}
}}