diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 2a314f2224469b65c8761b2823ec8dd2c3d16568..6a5bac13e8b3ecc471027e122a54248961ca9e7e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -12,7 +12,7 @@ *(MAXKEY-210811) 密码修改问题修复 *(MAXKEY-210812) 环境变量参数优化 *(MAXKEY-210813) 管理端图标显示修复 - *(MAXKEY-210814) 管理端‘应用管理’移动到‘配置管理’的菜单项 + *(MAXKEY-210814) 认证系统菜单项调整 *(MAXKEY-210815) OAuth的数据库加载增加本地缓存 *(MAXKEY-210816) 社交账号登录改为存储在数据库中,方便用户更改 *(MAXKEY-210817) 账号策略管理及动态适配 @@ -21,13 +21,15 @@ *(MAXKEY-210820) 企业微信扫码登录js更新wwLogin-1.2.4.js *(MAXKEY-210821) 中文切换调整为下拉菜单 *(MAXKEY-210822) 移除原有的缓存方案 - *(MAXKEY-210823) 应用管理OAuth适配器显示问题修复 + *(MAXKEY-210823) 应用管理OAuth适配器显示问题修复 *(MAXKEY-210824) 图片验证码优化,增加随机颜色的字符生成实现,干扰线优化 - *(MAXKEY-210825) 依赖jar引用、更新和升级 + *(MAXKEY-210825) 菜单名称的调整 + *(MAXKEY-210826) JS脚本整合优化 + *(MAXKEY-210827) 依赖jar引用、更新和升级 spring 5.3.12 springboot 2.5.6 tomcat 9.0.54 - springSecurity 5.5.3 + springSecurity 5.5.3 springData 2.5.5 springSession 2.5.3 mybatis-jpa-extra 2.6 diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl index a1a13b8f7fde653b30deeb12c0c2b8fde147ef31..314626bbcd7f6f15bee4fa76e0f95df396f69fd5 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/layout/common.cssjs.ftl @@ -1,6 +1,6 @@ - + <#-- jquery base --> 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 836594272d1a262dc29e2c7b6a75dd04565370ec..996879d13ee24109e1abf77c4d60c684ae5ecc1a 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 @@ -3,12 +3,7 @@ <#include "layout/header.ftl"> <#include "layout/common.cssjs.ftl"> - - + <#if true==isKerberos> <@browser name="MSIE"> @@ -25,138 +20,6 @@ - -
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 56fd15d21ea819ed652abc15a0dae0db30053257..710238a6080a791506183c48bc1b6827b2146dd4 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 @@ -380,4 +380,27 @@ body{ .float-left{ float: left; -} \ No newline at end of file +} + +#div_normalLogin .wrapper , +#div_tfaLogin .wrapper , +#div_mobileLogin .wrapper{ + position: relative; +} + +#div_normalLogin .wrapper input, +#div_tfaLogin .wrapper input, +#div_mobileLogin .wrapper input { + text-indent: 20px; +} + +#div_normalLogin .wrapper i.fa, +#div_tfaLogin .wrapper i.fa, +#div_mobileLogin .wrapper i.fa{ + position: absolute; + top: 5px; + left: 5px; + font-size: 22px; + color: gray; +} + 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 new file mode 100644 index 0000000000000000000000000000000000000000..df1725eb074a41866c7ff8903c8700f79afa55cd --- /dev/null +++ b/maxkey-webs/maxkey-web-resources/src/main/resources/static/javascript/login.js @@ -0,0 +1,114 @@ + 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 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 }); + }; + + 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; + } + 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