WANG 6 anni fa
parent
commit
40d8c72934

+ 5 - 0
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamOuterServiceProvider.java

@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
@@ -52,6 +53,10 @@ public class ExamOuterServiceProvider extends ControllerSupport implements ExamO
 	public OuterSaveExamResp saveExam(
 			@RequestBody @ApiParam(required = true) OuterSaveExamReq req) {
 
+		if (getSecurityRootOrgId().equals(req.getRootOrgId())) {
+			throw new StatusException("EX-1000001", "安全接入的顶级机构非法");
+		}
+
 		Date beginTime = req.getBeginTime();
 		Integer duration = req.getDuration();
 		Date endTime = req.getEndTime();