From d94c8b14abe570d8babff27806e84a0575296f90 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 28 Oct 2026 14:48:53 +0900 Subject: [PATCH] =?UTF-8?q?261028=5F02=5FENH:=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=EC=B9=B4=ED=8A=B8=20=EC=97=B0=EA=B2=B0=ED=95=98?= =?UTF-8?q?=EB=A9=B4=EC=84=9C=20=EA=B5=AC=EB=B2=84=EC=A0=84=20kfunc=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=98=A4=EB=A5=98=20=EC=9E=A1=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectTemplate/include/Header.asp | 2 +- include/ajax_crud.asp | 10 +++++ module/survey.js | 72 ++++++++++++++++++------------ 3 files changed, 54 insertions(+), 30 deletions(-) diff --git a/ProjectTemplate/include/Header.asp b/ProjectTemplate/include/Header.asp index c5f2ef9..a5f9cc1 100644 --- a/ProjectTemplate/include/Header.asp +++ b/ProjectTemplate/include/Header.asp @@ -21,7 +21,7 @@ - + diff --git a/include/ajax_crud.asp b/include/ajax_crud.asp index 3e596bc..92c6b46 100644 --- a/include/ajax_crud.asp +++ b/include/ajax_crud.asp @@ -109,8 +109,18 @@ END IF '-- 20251029 박준성 당분간 모든 요청에 대해서 서버에 로그를 쌓기' + On Error Resume Next + + Err.Clear CALL INSERT_REQUEST_LOG(IsReject) + If Err.Number <> 0 Then + Response.AppendToLog " LogInsertError=" & CStr(Err.Number) + Err.Clear + End If + + On Error GoTo 0 + If IsReject = "1" Then Response.Status = "401 Unauthorized" Response.AddHeader "Cache-Control", "no-store" diff --git a/module/survey.js b/module/survey.js index 7901275..c431ae7 100644 --- a/module/survey.js +++ b/module/survey.js @@ -134,16 +134,25 @@ kon.survey = (function () { }) } - function submitNextPage(form, waits) { + function submitNextPage(form, waits) { + + // undefined 또는 잘못된 Promise 제거 + waits = waits.filter(function (wait) { + return wait && typeof wait.always === "function"; + }); + var remaining = waits.length; + if (remaining === 0) { form.attr("onsubmit", ""); form.submit(); return; } + waits.forEach(function (wait) { wait.always(function () { remaining--; + if (remaining === 0) { form.attr("onsubmit", ""); form.submit(); @@ -192,38 +201,43 @@ kon.survey = (function () { } function callKartDerived(pkey, idkey) { - var url = KART_BASE_URL - + "/project/" + KART_PROJECT_TYPE - + "/" + encodeURIComponent(pkey) - + "/derived/respondent/" + encodeURIComponent(idkey) - + "/recalculate"; + try{ + var url = KART_BASE_URL + + "/project/" + KART_PROJECT_TYPE + + "/" + encodeURIComponent(pkey) + + "/derived/respondent/" + encodeURIComponent(idkey) + + "/recalculate"; - logExternalApi("DERIVED", idkey, "", "REQUEST", ""); + logExternalApi("DERIVED", idkey, "", "REQUEST", ""); - return $.ajax({ - url: url, - type: "POST", - headers: { - "X-API-Key": KON_KIWI_API_KEY - }, - dataType: "json", - cache: false, - timeout: 60000, + return $.ajax({ + url: url, + type: "POST", + headers: { + "X-API-Key": KON_KIWI_API_KEY + }, + dataType: "json", + cache: false, + timeout: 60000, - success: function (data, status, xhr) { - logExternalApi( - "DERIVED", idkey, "", "SUCCESS", - "HTTP " + xhr.status - ); - }, + success: function (data, status, xhr) { + logExternalApi( + "DERIVED", idkey, "", "SUCCESS", + "HTTP " + xhr.status + ); + }, - error: function (xhr, status) { - logExternalApi( - "DERIVED", idkey, "", "FAIL", - "HTTP " + xhr.status + " / " + status - ); - } - }); + error: function (xhr, status) { + logExternalApi( + "DERIVED", idkey, "", "FAIL", + "HTTP " + xhr.status + " / " + status + ); + } + }); + } + catch(ex){ + return $.Deferred().resolve().promise(); + } } function callContactStatusApi(contactMappingList, idkey, statuses) {