|
|
|
|
@ -598,7 +598,8 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
_ref$hackidentifier = _ref.hackidentifier,
|
|
|
|
|
hackidentifier = _ref$hackidentifier === void 0 ? "" : _ref$hackidentifier,
|
|
|
|
|
_ref$items = _ref.items,
|
|
|
|
|
items = _ref$items === void 0 ? {} : _ref$items;
|
|
|
|
|
items = _ref$items === void 0 ? {} : _ref$items,
|
|
|
|
|
setIsSubmitCode = _ref.setIsSubmitCode;
|
|
|
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
|
|
|
|
|
_useState2 = _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
|
|
|
|
|
isloading = _useState2[0],
|
|
|
|
|
@ -743,7 +744,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
if (!(ButtonText === '提交代码')) {
|
|
|
|
|
_context3.next = 20;
|
|
|
|
|
_context3.next = 21;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
setisloading(true);
|
|
|
|
|
@ -837,10 +838,11 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
case 18:
|
|
|
|
|
setisloading(false);
|
|
|
|
|
case 19:
|
|
|
|
|
!!setIsSubmitCode && setIsSubmitCode(true);
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
case 20:
|
|
|
|
|
case 21:
|
|
|
|
|
aa = true;
|
|
|
|
|
_context3.next = 23;
|
|
|
|
|
_context3.next = 24;
|
|
|
|
|
return form.validateFields().then(function () {
|
|
|
|
|
aa = false;
|
|
|
|
|
}, function (errInfo) {
|
|
|
|
|
@ -859,27 +861,27 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
});
|
|
|
|
|
aa = true;
|
|
|
|
|
});
|
|
|
|
|
case 23:
|
|
|
|
|
case 24:
|
|
|
|
|
if (!aa) {
|
|
|
|
|
_context3.next = 25;
|
|
|
|
|
_context3.next = 26;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
case 25:
|
|
|
|
|
case 26:
|
|
|
|
|
setisloading(true);
|
|
|
|
|
if (!isloading) {
|
|
|
|
|
_context3.next = 28;
|
|
|
|
|
_context3.next = 29;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return _context3.abrupt("return");
|
|
|
|
|
case 28:
|
|
|
|
|
case 29:
|
|
|
|
|
res = '';
|
|
|
|
|
formValues = form.getFieldsValue();
|
|
|
|
|
if (identifier) {
|
|
|
|
|
_context3.next = 39;
|
|
|
|
|
_context3.next = 40;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_context3.next = 33;
|
|
|
|
|
_context3.next = 34;
|
|
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems.json", {
|
|
|
|
|
method: 'post',
|
|
|
|
|
body: _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
|
|
|
|
|
@ -895,15 +897,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
is_blank: true
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
case 33:
|
|
|
|
|
case 34:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
identifier = (_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.identifier;
|
|
|
|
|
sessionStorage.projectFill = identifier;
|
|
|
|
|
setidentifier(identifier);
|
|
|
|
|
_context3.next = 42;
|
|
|
|
|
_context3.next = 43;
|
|
|
|
|
break;
|
|
|
|
|
case 39:
|
|
|
|
|
_context3.next = 41;
|
|
|
|
|
case 40:
|
|
|
|
|
_context3.next = 42;
|
|
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, ".json"), {
|
|
|
|
|
method: 'put',
|
|
|
|
|
body: _root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test5_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
|
|
|
|
|
@ -919,21 +921,21 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
is_blank: true
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
case 41:
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
case 42:
|
|
|
|
|
_context3.next = 44;
|
|
|
|
|
res = _context3.sent;
|
|
|
|
|
case 43:
|
|
|
|
|
_context3.next = 45;
|
|
|
|
|
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, "/start.json"), {
|
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
case 44:
|
|
|
|
|
case 45:
|
|
|
|
|
res1 = _context3.sent;
|
|
|
|
|
_context3.next = 47;
|
|
|
|
|
_context3.next = 48;
|
|
|
|
|
return onUpdateCode(null, res1 === null || res1 === void 0 ? void 0 : res1.identifier);
|
|
|
|
|
case 47:
|
|
|
|
|
case 48:
|
|
|
|
|
response = _context3.sent;
|
|
|
|
|
if (!((response === null || response === void 0 ? void 0 : response.status) === 0)) {
|
|
|
|
|
_context3.next = 56;
|
|
|
|
|
_context3.next = 57;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_executeCode = /*#__PURE__*/function () {
|
|
|
|
|
@ -990,15 +992,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
|
|
|
|
|
};
|
|
|
|
|
}();
|
|
|
|
|
_startTime = getTimeStamp();
|
|
|
|
|
_context3.next = 53;
|
|
|
|
|
_context3.next = 54;
|
|
|
|
|
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .sumbitCode */ .bM)(res1 === null || res1 === void 0 ? void 0 : res1.identifier, {});
|
|
|
|
|
case 53:
|
|
|
|
|
case 54:
|
|
|
|
|
_executeCode();
|
|
|
|
|
_context3.next = 57;
|
|
|
|
|
_context3.next = 58;
|
|
|
|
|
break;
|
|
|
|
|
case 56:
|
|
|
|
|
setisloading(false);
|
|
|
|
|
case 57:
|
|
|
|
|
setisloading(false);
|
|
|
|
|
case 58:
|
|
|
|
|
case "end":
|
|
|
|
|
return _context3.stop();
|
|
|
|
|
}
|