From cd2d87c5b26ce4ab75e440a8eabea67b8c1234f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sun, 8 Mar 2020 15:50:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/redux/actions/ojForm.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 1c88cec41..07ddbb48b 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -132,6 +132,7 @@ export const validateOjForm = (props, type, cb) => { } }); // 验证测试用例中的数组是否都有对应的值 + let tcbool=false; const tcValidResult = []; // 验证测试用例: 1.必须要有输出值 2. 输入值与输出值必须唯一 testCases.forEach((obj, i) => { @@ -143,6 +144,16 @@ export const validateOjForm = (props, type, cb) => { const errMsg = validateResult[key].errMsg; if (errMsg) { hasSuccess = false; + + if(tcbool===false){ + tcbool=true + notification['error']({ + message: '提示', + description: '测试用例必须填写输出!' + }); + + } + } else { // 唯一性校验 const bool = testCases.some((item, j) => {