Crystal.Sea преди 3 години
родител
ревизия
37da95c649

+ 2 - 1
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/login.ftl

@@ -36,7 +36,7 @@
 							
 						</td>
 						<td>
-				<table id="tableform">
+				<table class="logintableform">
 					<tr>
 						<td>
 							<ul id="switch_tab" class="switch_tab" style="width: 360px;">
@@ -57,6 +57,7 @@
 									<@locale code="login.text.login.mobile"/>
 									</a>
 								</li>
+								<!---->
 								<li id="qrcodelogin"   class="switch_tab_class col-md-4">
                                     <a href="javascript:void(0);">
                                     <@locale code="login.text.login.qrcode"/>

+ 12 - 12
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginmobile.ftl

@@ -21,24 +21,24 @@
 				<div  class="wrapper">
                 	<i class="fa fa-lock fa-2"></i>
 					<input required="" class="form-control"  type='password' id='mobile_j_password'  name='password' value=""  tabindex="2"  style="float: left;"/>
-					<input class="form-control"  id="mobile_j_otp_captcha_button" type="button"  tabindex="5" class="button"  value="<@locale code="login.text.login.mobile.obtain"/>"/>
+					<button  class="btn  btn-outline-secondary"  id="mobile_j_otp_button"  tabindex="5"  type="button" >
+                       <@locale code="login.text.login.mobile.obtain"/>
+                    </button>
 				</div>
 			</td>
 		</tr>
 		<#if true==isRemeberMe>
 		<tr> 
 			<td colspan="2">
-				<table  style="width:100%">
-					<tr>
-						<td style="width:50%">
-							<span class="form_checkbox_label">
-								<input type='checkbox' id="mobile_remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
-								<@locale code="login.text.remeberme"/>
-							</span>
-						</td>
-						<td style="width:50%"><a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a></td>
-					</tr>
-				</table>
+			     <div class="col-sm-6 float-left" style="line-height: 30px;">
+                     <span class="form_checkbox_label">
+                        <input type='checkbox' id="mobile_remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
+                        <@locale code="login.text.remeberme"/>
+                    </span>
+                </div>
+                <div class="col-sm-6  float-left"  style="line-height: 30px;">
+                     <a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a>
+                </div>
 			</td>								
 		</tr>
 		</#if>

+ 9 - 11
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/loginnormal.ftl

@@ -39,17 +39,15 @@
 		<#if true==isRemeberMe>
 		<tr>
 			<td colspan="2">
-				<table  style="width:100%">
-					<tr>
-						<td style="width:50%">
-							<span class="form_checkbox_label">
-								<input type='checkbox' id="remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
-								<@locale code="login.text.remeberme"/>
-							</span>
-						</td>
-						<td style="width:50%"><a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a></td>
-					</tr>
-				</table>
+			    <div class="col-sm-6 float-left" style="line-height: 30px;">
+			         <span class="form_checkbox_label">
+                        <input type='checkbox' id="remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
+                        <@locale code="login.text.remeberme"/>
+                    </span>
+			    </div>
+			    <div class="col-sm-6  float-left"  style="line-height: 30px;">
+			         <a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a>
+                </div>
 			</td>								
 		</tr>
 		</#if>

+ 12 - 26
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/logintfa.ftl

@@ -31,39 +31,25 @@
 				<div  class="wrapper">
 					<i class="fa fa-lock fa-2"></i>
 					<input required="" class="form-control"  type='text' id="tfa_j_otp_captcha" name="otpCaptcha"  tabindex="3"  value=""   style="float: left;"/>
-					<input class="form-control"  id="tfa_j_otp_captcha_button" type="button"  tabindex="5" class="button"  value="<@locale code="login.text.login.twofactor.obtain"/>"/>
+					<button  class="btn  btn-outline-secondary"  id="tfa_j_otp_button"  tabindex="5"  type="button" >
+					   <@locale code="login.text.login.twofactor.obtain"/>
+					</button>
 				</div>
 			</td>
 		</tr>
-		<#if "TOPT"==otpType >
-		<tr>
-			<td><@locale code="login.text.currenttime"/>:</td>
-			<td>
-				<input  class="form-control"  readonly type='text' id="currentTime" name="currentTime"  tabindex="3"  value="" />
-			</td>
-		</tr>
-		</#if>
-		<tr>
-			<td></td>
-			<td>
-				<div id="currentTime"></div>
-			</td>
-		</tr>
 		</#if>
 		<#if true==isRemeberMe>
 		<tr> 
 			<td colspan="2">
-				<table  style="width:100%">
-					<tr>
-						<td style="width:50%">
-							<span class="form_checkbox_label">
-								<input type='checkbox' id="tfa_remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
-								<@locale code="login.text.remeberme"/>
-							</span>
-						</td>
-						<td style="width:50%"><a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a></td>
-					</tr>
-				</table>
+			     <div class="col-sm-6 float-left" style="line-height: 30px;">
+                     <span class="form_checkbox_label">
+                        <input type='checkbox' id="tfa_remeberMe" name="remeberMe"  class="checkbox"   tabindex="4"  value="remeberMe" />
+                        <@locale code="login.text.remeberme"/>
+                    </span>
+                </div>
+                <div class="col-sm-6  float-left"  style="line-height: 30px;">
+                     <a href="<@base />/forgotpassword/forward"><@locale code="login.text.forgotpassword"/></a>
+                </div>
 			</td>								
 		</tr>
 		</#if>

+ 43 - 93
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,18 +271,13 @@ body{
 }
 
 #tfa_j_otp_captcha,#mobile_j_password{
-	width	:110px;
-	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;
 	height: 33px;
@@ -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;
+}

+ 46 - 107
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 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);
-    }
+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 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){ 
+}
+
+$(function(){
+    //setInterval("currentTime()", 1000);
+
+    $(".doLoginSubmit").on("click",function(){
             doLoginSubmit();
-        };
-    };
-    
-    $(function(){
-        //setInterval("currentTime()", 1000);
+    });
+    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();
+    }
     
-        $(".doLoginSubmit").on("click",function(){
-                doLoginSubmit();
+    //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);
         });
-        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);
-        });
-        
-
-    });
+        //倒计时60秒
+        countDownTimer=setInterval("doCountDownTimer()", 1000);
+    });
+    
+});