diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..3525aee --- /dev/null +++ b/.env.sample @@ -0,0 +1 @@ +MAIL_TO="songwritersg@naver.com" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4f53f51..accc028 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,6 @@ package-lock.json yarn.lock .yarn -.yarnrc.yml \ No newline at end of file +.yarnrc.yml + +.env \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 4b93c1c..a5793dd 100644 --- a/dist/index.html +++ b/dist/index.html @@ -538,7 +538,10 @@
@@ -681,14 +684,33 @@ type: "POST", data: formData, dataType: "json", + beforeSend: function() { + $("#btn-submit").attr('disabled',true) + $('#btn-submit .text').hide() + $("#btn-submit .loading").show() + }, success: function() { alert("상담 신청이 완료되었습니다.") + + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() + $('[data-form="request-form"]').reset() }, error: function(err) { var message = err?.responseJSON?.error ?? "상담 신청도중 오류가 발생하였습니다.\\n서버 관리자에게 문의하세요" + + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() alert(message) + }, + complete: function() { + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() } }) }) diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..25a1241 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,13 @@ +module.exports = { + apps: [ + { + name: "intelligence-security", + script: "./dist/server.js", + watch: false, + env: { + NODE_ENV: "production", + PORT: 3070 + } + } + ] +}; \ No newline at end of file diff --git a/src-server/email.ts b/src-server/email.ts index 1041042..329ad43 100644 --- a/src-server/email.ts +++ b/src-server/email.ts @@ -14,8 +14,7 @@ export const sendEmail = async (subject: string, text: string) => { const mailOptions = { from: "support@wheeparam.com", - //to: "songwritersg@naver.com", - to : "whee0716@gmail.com", + to : process.env.MAIL_TO, subject, text, }; diff --git a/src/html/index.html b/src/html/index.html index adef68e..0ab2dd8 100644 --- a/src/html/index.html +++ b/src/html/index.html @@ -448,7 +448,10 @@ @@ -591,14 +594,33 @@ type: "POST", data: formData, dataType: "json", + beforeSend: function() { + $("#btn-submit").attr('disabled',true) + $('#btn-submit .text').hide() + $("#btn-submit .loading").show() + }, success: function() { alert("상담 신청이 완료되었습니다.") + + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() + $('[data-form="request-form"]').reset() }, error: function(err) { var message = err?.responseJSON?.error ?? "상담 신청도중 오류가 발생하였습니다.\\n서버 관리자에게 문의하세요" + + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() alert(message) + }, + complete: function() { + $("#btn-submit").removeAttr('disabled') + $('#btn-submit .text').show() + $("#btn-submit .loading").hide() } }) })