|
|
@ -102,13 +102,12 @@ export const getUserProgramDetail = (identifier, type) => {
|
|
|
|
|
|
|
|
|
|
|
|
export const saveUserCodeForInterval = (identifier, code) => {
|
|
|
|
export const saveUserCodeForInterval = (identifier, code) => {
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
const { userCode } = getState().ojForUserReducer;
|
|
|
|
|
|
|
|
dispatch({
|
|
|
|
dispatch({
|
|
|
|
type: types.AUTO_UPDATE_CODE,
|
|
|
|
type: types.AUTO_UPDATE_CODE,
|
|
|
|
payload: true
|
|
|
|
payload: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
fetchUpdateCode(identifier, {
|
|
|
|
fetchUpdateCode(identifier, {
|
|
|
|
code: Base64.encode(userCode)
|
|
|
|
code: Base64.encode(code)
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
if (res.data.status === 401) {
|
|
|
|
if (res.data.status === 401) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -135,7 +134,6 @@ export const saveUserCodeForInterval = (identifier, code) => {
|
|
|
|
* @param {*} type 测评类型 debug | submit
|
|
|
|
* @param {*} type 测评类型 debug | submit
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export const updateCode = (identifier, inputValue, type) => {
|
|
|
|
export const updateCode = (identifier, inputValue, type) => {
|
|
|
|
console.log(1111);
|
|
|
|
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
return (dispatch, getState) => {
|
|
|
|
const { userCode, isUpdateCode } = getState().ojForUserReducer;
|
|
|
|
const { userCode, isUpdateCode } = getState().ojForUserReducer;
|
|
|
|
if (isUpdateCode) {
|
|
|
|
if (isUpdateCode) {
|
|
|
|