|
@@ -17,10 +17,12 @@ import cn.com.qmth.examcloud.app.model.Result;
|
|
|
import cn.com.qmth.examcloud.app.service.CoreOeService;
|
|
|
import cn.com.qmth.examcloud.app.core.SysProperty;
|
|
|
import okhttp3.FormBody;
|
|
|
+import okhttp3.FormBody.Builder;
|
|
|
import okhttp3.MediaType;
|
|
|
import okhttp3.MultipartBody;
|
|
|
import okhttp3.RequestBody;
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -272,13 +274,16 @@ public class CoreOeServiceImpl implements CoreOeService {
|
|
|
public Result getYunSignature(String key, String token, GetYunSignatureReq req) throws Exception {
|
|
|
//封装请求参数
|
|
|
final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/yunSignature", sysProperty.getCoreOeStudentUrl());
|
|
|
- RequestBody formBody = new FormBody.Builder()
|
|
|
+ Builder b= new FormBody.Builder()
|
|
|
.add("examRecordDataId", req.getExamRecordDataId())
|
|
|
.add("order", req.getOrder())
|
|
|
.add("fileMd5", req.getFileMd5())
|
|
|
- .add("fileSuffix", req.getFileSuffix())
|
|
|
- .add("ext", req.getExt())
|
|
|
- .build();
|
|
|
+ .add("fileSuffix", req.getFileSuffix());
|
|
|
+ if(StringUtils.isNotBlank(req.getExt())) {
|
|
|
+ b.add("ext", req.getExt());
|
|
|
+ }
|
|
|
+ RequestBody formBody =b.build();
|
|
|
+
|
|
|
return HttpUtils.doPost(requestUrl, formBody, key, token);
|
|
|
}
|
|
|
|