|
|
@ -4,7 +4,7 @@
|
|
|
|
* @Github:
|
|
|
|
* @Github:
|
|
|
|
* @Date: 2019-11-27 13:42:11
|
|
|
|
* @Date: 2019-11-27 13:42:11
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditTime : 2020-01-07 14:45:52
|
|
|
|
* @LastEditTime : 2020-01-07 16:21:53
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
import types from "./actionTypes";
|
|
|
|
import types from "./actionTypes";
|
|
|
|
import { Base64 } from 'js-base64';
|
|
|
|
import { Base64 } from 'js-base64';
|
|
|
@ -148,11 +148,12 @@ 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) {
|
|
|
|
fetchUpdateCode(identifier, {
|
|
|
|
fetchUpdateCode(identifier, {
|
|
|
|
code: userCode
|
|
|
|
code: Base64.encode(userCode)
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
// 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现
|
|
|
|
// 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现
|
|
|
|
// TODO 需要优化
|
|
|
|
// TODO 需要优化
|
|
|
|