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) => {