From 560af98fa772725f6910df8dfbb7477887f13b54 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 1 Apr 2024 10:39:40 +0900 Subject: [PATCH] no message --- src/main/webapp/WEB-INF/jsp/login.jsp | 44 +++++++++++++++------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/login.jsp b/src/main/webapp/WEB-INF/jsp/login.jsp index f6a729c5..333b7b17 100644 --- a/src/main/webapp/WEB-INF/jsp/login.jsp +++ b/src/main/webapp/WEB-INF/jsp/login.jsp @@ -104,30 +104,18 @@ ${functions} function login() { if (!$("#formAuthentication input").validInputs()) return; - - var params = { - account:$("#userId").val(), - password:$("#password").val(), - institute:$("#institute").val() - <%--, rememberCredentials:true--%> - }; + account:$("#userId").val(), + password:$("#password").val(), + institute:$("#institute").val() + <%--, rememberCredentials:true--%> + }; + json.post({ url:wctx.url("/login.do"), data:params, success:function(resp) { - if (resp.authenticated) { - if (resp.message) - dialog.alert({ - content : resp.message, - init : function() { - setDialogZindex(); - focusClose(); - }, - }); - - wctx.home(); - } else { + if (!(resp.authenticated)) { dialog.alert({ content:resp.reason, init : function() { @@ -136,7 +124,25 @@ function login() { }, onClose:() => $("#userId").focus() }); + return; } + + if(resp.message){ + dialog.alert({ + content : resp.message, + init : function() { + setDialogZindex(); + focusClose(); + }, + onOK : function() { + wctx.home(); + } + }); + return; + } + + wctx.home(); + } }); }