diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl index 996879d13..cc0b7adcb 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl @@ -36,7 +36,7 @@ - +
<#if true==isRemeberMe> diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginnormal.ftl b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginnormal.ftl index f763beca6..ef5f0a5d4 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginnormal.ftl +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginnormal.ftl @@ -39,17 +39,15 @@ <#if true==isRemeberMe> diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/logintfa.ftl b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/logintfa.ftl index 920f4f035..dfc8d9227 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/logintfa.ftl +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/logintfa.ftl @@ -31,39 +31,25 @@
- "/> +
- <#if "TOPT"==otpType > - - - - - - - - - <#if true==isRemeberMe> diff --git a/maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css b/maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css index 710238a60..7d2a35072 100644 --- a/maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css +++ b/maxkey-webs/maxkey-web-resources/src/main/resources/static/css/base.css @@ -166,6 +166,39 @@ body{ text-decoration: none; } +/*switch_tab*/ + +.switch_tab{ + list-style: none; + border: 0; + cellspacing:0; + padding-left: 0; +} + +.switch_tab_class{ + float:left; + height:36px; + text-align: center; + display: inline-block; +} + +.switch_tab_class a{ + text-decoration: none; + display: inline-block; + height: 14px; + color: #333; + font-size: 14px; + font-weight: bold; + padding: 8px 0; + vertical-align: central; +} + +.switch_tab_current{ + background-color: #f3f6f7;; + border-right: 1px solid #e3e3e3; + border-bottom: 1px solid #e3e3e3; +} + .form_radio_label, .form_checkbox_label{ display: inline-block; text-align: left; @@ -208,94 +241,9 @@ body{ display: inline-block; margin-top: -0.2em; } - -.select-menu-modal{ - position: absolute; - display: none; - z-index: 1989; - width: 300px; - margin-top: 4px; - margin-bottom: 20px; - overflow: hidden; - font-size: 12px; - color: #666; - background-color: #fff; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0,0,0,0.15); - border-radius: 5px; - box-shadow: 0 3px 12px rgba(0,0,0,0.25); -} - -.select-menu-item{ - cursor: pointer; - line-height: 33px; - border-bottom: 1px solid #eee; - display: table; - table-layout: fixed; - width: 100%; - overflow: hidden; - color: inherit; - text-align: left; -} -.select-menu-item a{ - text-decoration : none; -} - - -.select-menu-item a div{ - width: 140px; - line-height: 33px; -} - - - - -.select-menu-item-selected{ - background-color: #4183c4; - color: #fff; -} - -.select-menu-item-selected a{ - color: #fff; -} - -/*switch_tab*/ - -.switch_tab{ - list-style: none; - border: 0; - cellspacing:0; - padding-left: 0; -} - -.switch_tab_class{ - float:left; - height:36px; - text-align: center; - display: inline-block; -} - -.switch_tab_class a{ - text-decoration: none; - display: inline-block; - height: 14px; - color: #333; - font-size: 14px; - font-weight: bold; - padding: 8px 0; - vertical-align: central; -} - -.switch_tab_current{ - background-color: #f3f6f7;; - border-right: 1px solid #e3e3e3; - border-bottom: 1px solid #e3e3e3; -} - /* logins */ -#tableform{ +.logintableform{ border: 1px solid #e9eeed; cellspacing:0; } @@ -323,17 +271,12 @@ body{ } #tfa_j_otp_captcha,#mobile_j_password{ - width :110px; + width :120px; font-size: 14px; font-weight: bold; } -#tfa_j_otp_captcha_button,#mobile_j_otp_captcha_button{ - width :120px; - height: 34px; - font-size: 14px; - font-weight: bold; -} + #j_captchaimg{ width:70px; @@ -404,3 +347,10 @@ body{ color: gray; } +#tfa_j_otp_button,#mobile_j_otp_button{ + width :130px; + height: 34px; + font-size: 14px; + font-weight: bold; + text-indent: 1px; +} diff --git a/maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js b/maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js index df1725eb0..708b377dd 100644 --- a/maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js +++ b/maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js @@ -1,114 +1,53 @@ - var captchaCountTimer; - var captchaCount=60; - function getCaptchaCount(){ - $("#mobile_j_otp_captcha_button").val("重新获取("+captchaCount+")秒"); - - - captchaCount--; - if(captchaCount==0){ - $("#mobile_j_otp_captcha_button").val("发送验证码"); - captchaCount=60; - clearInterval(captchaCountTimer); - } - } - var fullYear=currentDate.getFullYear(); - var month=currentDate.getMonth()+1; - var date=currentDate.getDate(); +var currentSwitchTab="normalLogin"; +function doLoginSubmit(){ + $.cookie("mxk_login_username", $("#"+currentSwitchTab+"Form input[name=username]").val(), { expires: 7 }); + $("#"+currentSwitchTab+"SubmitButton").click(); + $.cookie("mxk_login_switch_tab", currentSwitchTab, { expires: 7 }); +}; - var hours=currentDate.getHours(); - var minutes=currentDate.getMinutes(); - var seconds=currentDate.getSeconds(); - var strTime=""; - function formatTime(){ - strTime=fullYear+"-"; - strTime+=(month<10?"0"+month:month)+"-"; - strTime+=(date<10?"0"+date:date)+" "; - strTime+=(hours<10?"0"+hours:hours)+":"; - strTime+=(minutes<10?"0"+minutes:minutes)+":"; - strTime+=(seconds<10?"0"+seconds:seconds); - } - - function currentTime(){ - seconds++; - if(seconds>59){ - minutes++; - seconds=0; - } - if(minutes>59){ - hours++; - minutes=0; - } - if(hours>23){ - date++; - hours=0; - } - formatTime(); - //for timebase token - getTimeBaseCount(); - - $("#currentTime").val(strTime); - } - - var timeBaseCount; - function getTimeBaseCount(){ - if(seconds<30){ - timeBaseCount=30-seconds; - }else{ - timeBaseCount=30-(seconds-30); - } - $("#tfa_j_otp_captcha_button").val("剩余时间("+timeBaseCount+")秒"); - }; - var currentSwitchTab="normalLogin"; - function doLoginSubmit(){ - $.cookie("mxk_login_username", $("#"+currentSwitchTab+"Form input[name=username]").val(), { expires: 7 }); - $("#"+currentSwitchTab+"SubmitButton").click(); - $.cookie("mxk_login_switch_tab", currentSwitchTab, { expires: 7 }); +document.onkeydown=function(event){ + var e = event || window.event || arguments.callee.caller.arguments[0]; + if(e && e.keyCode==13){ + doLoginSubmit(); }; +}; - function switchTab(id){ - if($("#"+id+"Form input[name=username]").val()==""){ - $("#"+id+"Form input[name=username]").focus(); - }else{ - $("#"+id+"Form input[name=password]").focus(); - } - currentSwitchTab=id; +var countDownTimer;var captchaCount=60; +function doCountDownTimer(){ + $("#mobile_j_otp_button").val("重新获取("+captchaCount+")秒"); + captchaCount--; + if( captchaCount<=0 ){ + $("#mobile_j_otp_button").val("发送验证码"); + captchaCount=60; + clearInterval(countDownTimer); } - document.onkeydown=function(event){ - var e = event || window.event || arguments.callee.caller.arguments[0]; - if(e && e.keyCode==13){ - doLoginSubmit(); - }; - }; - - $(function(){ - //setInterval("currentTime()", 1000); - - $(".doLoginSubmit").on("click",function(){ - doLoginSubmit(); - }); - var cookieLoginUsername = $.cookie("mxk_login_username"); - if(cookieLoginUsername != undefined && cookieLoginUsername != ""){ - var switch_tab=$.cookie("mxk_login_switch_tab")==undefined ? "normalLogin" : $.cookie("mxk_login_switch_tab"); - $("#"+switch_tab).click(); - $("#"+switch_tab+"Form input[name=username]").val(cookieLoginUsername ==undefined ? "" : cookieLoginUsername); - $("#div_"+switch_tab+" input[name=password]").focus(); - }else{ - $("#div_normalLogin input[name=username]").focus(); - } - $("#mobile_j_otp_captcha_button").on("click",function(){ - if(captchaCount<60){ - return; - } - var loginName = $("#mobile_j_username").val(); - if(loginName == ""){ - return; - } - $.get(webContextPath +"/login/sendsms/"+loginName,function(data,status){ - //alert("Data: " + data + "\nStatus: " + status); - }); - - captchaCountTimer=setInterval("getCaptchaCount()", 1000); - }); - +} - }); \ No newline at end of file +$(function(){ + //setInterval("currentTime()", 1000); + + $(".doLoginSubmit").on("click",function(){ + doLoginSubmit(); + }); + var cookieLoginUsername = $.cookie("mxk_login_username"); + if(cookieLoginUsername != undefined && cookieLoginUsername != ""){ + var switch_tab=$.cookie("mxk_login_switch_tab")==undefined ? "normalLogin" : $.cookie("mxk_login_switch_tab"); + $("#"+switch_tab).click(); + $("#"+switch_tab+"Form input[name=username]").val(cookieLoginUsername ==undefined ? "" : cookieLoginUsername); + $("#div_"+switch_tab+" input[name=password]").focus(); + }else{ + $("#div_normalLogin input[name=username]").focus(); + } + + //send sms to mobile + $("#mobile_j_otp_button").on("click",function(){ + var loginName = $("#mobile_j_username").val(); + if(captchaCount<60 || loginName == ""){return; } + $.get(webContextPath +"/login/sendsms/"+loginName,function(data,status){ + //alert("Data: " + data + "\nStatus: " + status); + }); + //倒计时60秒 + countDownTimer=setInterval("doCountDownTimer()", 1000); + }); + +}); \ No newline at end of file
- - - - - -
- - - <@locale code="login.text.remeberme"/> - - <@locale code="login.text.forgotpassword"/>
+
+ + + <@locale code="login.text.remeberme"/> + +
+
- - - - - -
- - - <@locale code="login.text.remeberme"/> - - <@locale code="login.text.forgotpassword"/>
+
+ + + <@locale code="login.text.remeberme"/> + +
+
<@locale code="login.text.currenttime"/>: - -
-
-
- - - - - -
- - - <@locale code="login.text.remeberme"/> - - <@locale code="login.text.forgotpassword"/>
+
+ + + <@locale code="login.text.remeberme"/> + +
+