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