Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
success: res => {
if (res !== 'ok') {
Message.error(res);
return;
}
this.hide();
getInstanceList();
},
complete: () => closeLoading(),
handleImport = () => {
Message.error('暂不支持导入');
};
UserAjax.getChildrenCate(val).then((res)=>{
if(res.data.status===0){
this.setState({
parentId:val,
categoryData:res.data.data
})
}else{
Message.error("该分类无子分类")
}
})
}}
success: res => {
if (res !== 'ok') {
Message.error(res);
return;
}
this.hide();
getServiceDetail();
},
complete: () => closeLoading(),
return async (dispatch) => {
dispatch(userLogoutRequest());
try {
const response = await postUserLogout();
dispatch(userLogoutSuccess(response.data));
if (response.data.status === 200) {
Message.success('已登出');
setAuthority(response.data.currentAuthority);
reloadAuthorized();
dispatch(push('/user/login'));
} else {
Message.error('请稍后重试');
}
} catch (error) {
dispatch(userLogoutFailure(error));
}
};
};
}, (error) => {
if (error.response) {
const { status } = error.response;
Message.error(`HTTP ERROR: ${status}`);
} else {
Message.error(API_GENERAL_ERROR_MESSAGE);
}
return Promise.reject(error);
});
file.load('.json').then(content => {
try {
this.importRef.current!.show(JSON.parse(content));
} catch (e) {
Message.error(e.message);
}
});
}
getCodeVal() {
const { locale = {} } = this.props;
const { type, content } = this.state.form;
const codeVal = this.monacoEditor ? this.monacoEditor.getValue() : content;
if (!codeVal) {
Message.error({
content: locale.submitFailed,
align: 'cc cc',
});
return false;
}
return codeVal;
}