peternameyakj
2025-01-06 4c82733d79b03ee1d5304398b0598d826e6fd0e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
<%@ page language="java" import="security.*"%>
<%@ include file="include/basePath.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>log in</title>
<style type="text/css">
body {    
    min-height: 100%;
    width: 100%;
    background-color:#e6e9ed;
    overflow: hidden;
}
.l-box1{     position: fixed;
    top: 50%;
    left: 50%;
    margin-left: -210px;
    margin-top: -146px;}
.tit01{    
    font-size: 26px;
    color: #1890ff;
    margin: 0 auto 40px auto;
    text-align: center;
    font-weight: 700;}
.ip01{width:420px; margin:0 auto 30px auto; text-align:center;}
.ip03{ width:420px; height:50px; line-height:50px; border:0px; font-size:16px; text-indent:45px;border-radius:5px; color: #000;}
.ip-n{ background:url(image/n2.png) no-repeat 15px center #fff; background-size:25px;}
.ip-p{ background:url(image/p2.png) no-repeat 15px center #fff; background-size:25px;}
.bn01{ background:#1890ff; color:#fff; font:20px/30px Arial, Helvetica, sans-serif; padding:14px 0; width:420px; border:0; border-radius:5px;}
.footer{height: 40px;
    line-height: 40px;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    font-family: Arial;
    font-size: 12px;
    letter-spacing: 1px;
}
.h-t{color: #ff4949;
    font-size: 12px;
    line-height: 1.4;
    padding-top: 4px;
    text-align: left;
    display:none;
</style>
</head>
 
<body>
<div class="l-box1">
<form action="<%=basePath%>public/login.action"  onsubmit="return toVaild()"
                            class="ng-pristine ng-invalid ng-touched" method="post">
  <div class="tit01"></div>
  <div class="ip01">
      <input id="j_username" name="j_username" type="text" class="ip03 ip-n" placeholder="User name" />
  <div class="h-t ht-name">请输入您的账号</div>
  </div>
  <div class="ip01">
      <input id="j_password" name="j_password" type="password" class="ip03 ip-p" placeholder="Password" />
  <div class="h-t ht-pwd">请输入您的密码</div>
  </div>
  <div class="ip01">
      <input id="googleAuthCode" name="googleAuthCode" type="text" class="ip03 ip-p" placeholder="GoogleAuthCode"/>
  <div class="h-t ht-code">请输入谷歌验证码</div>
  
  </div>
  <div class="ip01"><input name="提交" type="submit" class="bn01" value="Log in"/></div>
  </form>
</div>
  <div class="footer">Copyright © 2018-2021 malaifa All Rights Reserved.</div>
</body>
</html>
<input type="hidden" name="error" id="error" value="${error}" />
 
<script type="text/javascript" src="<%=basePath%>js/jquery.min.js"></script>
<script type='text/javascript'>
 
//初始化执行一次
setTimeout(function() {
  start();    
}, 100);
 
function start() {      
    var error = $("#error").val();
    if (null == error || "" == error) {
        $(".ht-code").hide();
      } else {
        $(".ht-code").show();
        $(".ht-code").html(error);  
        return false;
    }
}
 
var userVal,passVal,codeVal
 
function toVaild(){
 
    
    userVal = $('#j_username').val()
    passVal = $('#j_password').val()
    codeVal = $('#googleAuthCode').val()
    
    if(!userVal && !passVal && !codeVal){
        $(".ht-name").show();
        $(".ht-pwd").show();
        $(".ht-code").show();
        return false;
    }
    if(!userVal){
        $(".ht-name").show();
    }
    if(!passVal){
        $(".ht-pwd").show();
    }
    if(!codeVal){
        $(".ht-code").show();
    }
    
    if(userVal){
        $(".ht-name").hide();
    }
    if(passVal){
        $(".ht-pwd").hide();
    }
    if(codeVal){
        $(".ht-code").hide();
    }
    
    if(!userVal || !passVal || !codeVal){
        return false;
    }
    
}
 
function clickSbbmit(e){
      e.preventDefault();
      
    console.log(passVal,userVal) 
 
    }
</script>