Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then( res => {
// console.log('applyAfterware res',res);
// else if ( res.data.publicBoard == null ) {
// next();
// }
if ( res.code === 401 || res.code === 403 ) {
// unauthorized, logout and redirect to login page
if ( window.location.pathname != '/auth/logout' ) {
message.info( translate('global.token.expired') );
browserHistory.push('/auth/logout');
}
}
else if ( res.errors && res.errors.length > 0 ) {
if ( res.errors[0].path === '_id' ) {
message.warning( translate('global.record.empty') );
browserHistory.push('/dashboard');
}
else { next(); }
}
else {
next();
}
});
resultDataUp: aUnPassed
})
this.setState({
submit: true,
resultCode: result_code,
unsubmit: false,
})
}
this.setState({
resultCode: result_code,
unsubmit: false
})
}
if (solution && solution['result_code'] === -1) {
timers && clearInterval(timers)
message.info('题目未上传')
this.setState({
unsubmit: false
})
}
if (solution && solution['result_code'] === -2) {
message.info('正在判题....')
}
if (solution && solution['result_code'] === -3) {
message.info('服务器异常')
timers && clearInterval(timers)
}
if (count >= Count) {
timers && clearInterval(timers)
console.log('时间到了,定时器被清除啦')
if (!solution) {
message.error('当前排队人数太多,请重新提交')
});
await this.recrod.acquire();
}
if (this.state.isRecord) {
try {
if (isMediaRun) {
const resp = await this.recrod.query();
if (resp.serverResponse.fileList) {
const res = await this.recrod.stop();
this.props.setMediaSource(res.serverResponse.fileList);
message.info("结束录制");
const time = new Date();
this.props.setStopTime(time.getTime());
this.setState({isRecord: false});
} else {
message.info("录制时间过短");
}
} else {
message.info("结束录制");
const time = new Date();
this.props.setStopTime(time.getTime());
this.setState({isRecord: false});
}
} catch (err) {
console.log(err);
}
} else {
if (isMediaRun) {
try {
await this.recrod.start();
message.success("开始录制");
const time = new Date();
if (this.state.isRecord) {
try {
if (isMediaRun) {
const resp = await this.recrod.query();
if (resp.serverResponse.fileList) {
const res = await this.recrod.stop();
this.props.setMediaSource(res.serverResponse.fileList);
message.info("结束录制");
const time = new Date();
this.props.setStopTime(time.getTime());
this.setState({isRecord: false});
} else {
message.info("录制时间过短");
}
} else {
message.info("结束录制");
const time = new Date();
this.props.setStopTime(time.getTime());
this.setState({isRecord: false});
}
} catch (err) {
console.log(err);
}
} else {
if (isMediaRun) {
try {
await this.recrod.start();
message.success("开始录制");
const time = new Date();
this.props.setStartTime(time.getTime());
this.setState({isRecord: true });
} catch (err) {
message.error("两次密码不一致");
return;
}
if ((itemKey === "password" || itemKey === "email") && actionId == null) {
message.warning("敏感操作,需校验密码");
this.setState({
isModelShow: true,
currentAction: itemKey,
currentShowKey: isShowKey
});
return;
}
try {
if (itemKey === "password") {
await httpUtil.post("/baseInfo/password", { actionId, password });
message.info("密码更新成功");
} else if (itemKey === "email") {
await httpUtil.post("/baseInfo/email", { actionId, email });
this.props.updateOne("newEmail", email);
message.info("新邮箱验证邮件已发送,请注意查收");
} else {
await httpUtil.post("/baseInfo/username", { username });
this.props.updateOne("username", username);
}
this.setState({ [isShowKey]: false });
} finally {
this.setState({ actionId: null });
}
}
(data) => {
message.info('删除成功!');
this.fetchTableData();
});
}
abnormal = async (id, type) => {
let resulData = await apiPost('/deviceMaintain/electricalErrorDevice',
{parentId: id,
parentType: type})
if (resulData.data !== null) {
window.location.href = '/deviceMaintain/electricalErrorDevice/' + id + ',11'
} else {
message.info('无异常信息')
}
}
refresh = async () => {
abnormal = async (id, type) => {
let resulData = await apiPost('/deviceMaintain/electricalErrorDevice',
{parentId: id,
parentType: type})
if (resulData.data !== null) {
window.location.href = '/deviceMaintain/electricalErrorDevice/' + id + ',10'
} else {
message.info('无异常信息')
}
}
refresh = async () => {
setTimeout(() => {
actions.wipePin();
removeItem('pin-code');
actions.logOut();
actions.deleteAccounts();
onInvalidate();
message.info(intl.formatMessage({ id: 'confirm-pin-code.invalidated' }));
}, 100);
};