|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-27 13:42:11
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-11-29 11:11:13
|
|
|
|
|
* @LastEditTime: 2019-11-29 12:03:51
|
|
|
|
|
*/
|
|
|
|
|
import types from "./actionTypes";
|
|
|
|
|
import { Base64 } from 'js-base64';
|
|
|
|
@ -90,7 +90,7 @@ export const debuggerCode = (identifier,value, type) => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchDebuggerCode(identifier, value).then(res => {
|
|
|
|
|
console.log('调用调试代码成功并返回结果: ', res);
|
|
|
|
|
// console.log('调用调试代码成功并返回结果: ', res);
|
|
|
|
|
const { status } = res;
|
|
|
|
|
if (status === 200) {
|
|
|
|
|
// 调试代码成功后,调用轮循接口, 注意: 代码执行的时间要小于设置的时间限制
|
|
|
|
@ -141,6 +141,12 @@ export const debuggerCode = (identifier,value, type) => {
|
|
|
|
|
type: types.CHANGE_USER_CODE_TAB,
|
|
|
|
|
payload: 'record'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 将按钮状态回滚
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.SUBMIT_LOADING_STATUS,
|
|
|
|
|
payload: false
|
|
|
|
|
});
|
|
|
|
|
// 重新调用一下提交记录接口
|
|
|
|
|
dispatch(getUserCommitRecord(identifier));
|
|
|
|
|
}
|
|
|
|
@ -153,6 +159,15 @@ export const debuggerCode = (identifier,value, type) => {
|
|
|
|
|
getCodeSubmit(intervalTime, time_limit, count++, timer);
|
|
|
|
|
}, intervalTime);
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.TEST_CODE_STATUS,
|
|
|
|
|
payload: ''
|
|
|
|
|
});
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.LOADING_STATUS,
|
|
|
|
|
payload: false
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -222,10 +237,20 @@ export const submitUserCode = (identifier, inputValue, type) => {
|
|
|
|
|
flag: false
|
|
|
|
|
});
|
|
|
|
|
fetchUserCodeSubmit(identifier).then(res => {
|
|
|
|
|
console.log('用户提交代码成功======》》》》》', res);
|
|
|
|
|
// console.log('用户提交代码成功======》》》》》', res);
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
dispatch(debuggerCode(identifier, inputValue, type || 'submit'));
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.SUBMIT_LOADING_STATUS,
|
|
|
|
|
payload: false
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.SUBMIT_LOADING_STATUS,
|
|
|
|
|
payload: false
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|