This commit is contained in:
leejunho 2023-12-21 11:40:20 +09:00
parent 644fdb2ceb
commit b1a85d554a

View File

@ -66,17 +66,22 @@
// 2. 파일을 가지고 ocr 요청
var outputFileNm = ocrAjaxCall();
if(outputFileNm = ''){
if(outputFileNm == ''){
alert('ocr 요청을 다시 시도해 주세요.');
return false;
}
console.log("outputFileNm :: ", outputFileNm);
// 3. 5초 마다 결과 조회 총 12번 호출, 호출횟수 > 12 = fail
const intervalId = setInterval(() =>
{
console.log("outputFileNm2 :: ", outputFileNm);
responResult = ocrResultAjaxCall(outputFileNm);
console.log("responResult :: ", responResult);
try {
if(responResult != null){
clearInterval(intervalId);
@ -109,7 +114,7 @@
var outputFileNm = "";
document.writeForm.taskName.value = self.crypto.randomUUID();
//document.writeForm.taskName.value = self.crypto.randomUUID();
var a = new Date();
var taskName = a.getFullYear().toString()+a.getMonth().toString()+a.getDay().toString()+a.getHours().toString()+a.getMinutes().toString()+a.getSeconds().toString()+a.getMilliseconds().toString();
document.writeForm.taskName.value = taskName;
@ -158,13 +163,16 @@
function ocrResultAjaxCall(outputFileNm){
var data;
document.resultForm.fileName.value = outputFileNm;
var form = document.resultForm;
var data = new FormData(form);
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: "/kccadr/textsence/textSenseProcessChkAjax.do",
data: {"outputFileNm": outputFileNm},
data: data,
dataType:'json',
async: false,
processData: false,
@ -228,6 +236,9 @@
</head>
<body>
<form name="resultForm" enctype="multipart/form-data" method="post">
<input type="hidden" name="fileName" value=""/>
</form>
<form name="writeForm" enctype="multipart/form-data" method="post">
<input type="hidden" name="limitcount" value="1" />