cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!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>${Constants.company_name}用户中心</title>
<style type="text/css">
/*等待加载*/
.loading_wrap{
    padding-top:20px;
    background:#FFF;
    border:5px solid #dadada;
    height:130px;
    width:300px;
    text-align:center;
    margin:0 auto;
}
</style>
<script type="text/javascript">
    if(top!=self){
         if(top.location != self.location)
              top.location=self.location;
    }
</script>
[#include "/business/pages/include/static.html" /]
<script type="text/javascript" src="${common_static}/static/script/jquery.initValue.js"></script>
<script type="text/javascript">
function switchBtn() {
    $("#logining").hide();
    $("#submitForm").show();
}
$(function() {
     //初始化用户名输入框
      $("#username").initValue({
      "initValue" : "用户名/邮箱",
      "initClass" : "font_666"
     });
     //初始化密码输入框
     /*
      $("#passwordText").initValue({
      "initValue" : "密码",
      "initClass" : "font_666"
     });
     */
    //初始化验证码输入框        
    $("#checkCode").initValue({
      "initValue" : "验证码",
      "initClass" : "font_666"
     });
     
     $("#passwordText").focus(function() {
        $(this).hide();
        $("#password").show().focus();
     });
     
     $("#password").blur(function() {
        if($(this).val()=="") {
           $(this).hide();
           $("#passwordText").show();
        }
     })
     
         var b = false;
         $("#submitForm").click(function() {
                 var errMsgEl = $("#errMsgU");
                    errMsgEl.hide();
                    $("#submitForm").hide();
               $("#logining").show();
             if(!b) {
                 b = true;
                 var usernameEl = $("#username");
                 var passwordEl = $("#password");
                 var checkCodeEle = $("#checkCode");
                 errMsgEl.empty();
               var username = usernameEl.val().replace(/(^\s*)|(\s*$)/g, "");
               var password = passwordEl.val();
               var checkCode = checkCodeEle.val();
               if (username=='用户名/邮箱'||username.length == 0 || !username.match(/^[a-zA-Z0-9_\u4e00-\u9fa5\uF900-\uFA2D]{2,20}$/)) {
                   usernameEl.focus();
                   errMsgEl.text("名称由2-20位的汉字,字母,数字,下划线组成");
                   errMsgEl.show();
                   switchBtn();
                   b = false;
                   return;
               }
               if(!password.match(/^[a-zA-Z0-9_]{6,18}$/)) {
                  $("#passwordText").trigger("focus");
                  errMsgEl.text("密码由6-18位的字母,数字,下划线组成");
                  errMsgEl.show();
                  switchBtn();
                  b = false;
                  return;
               }
                if (checkCode=='验证码'||checkCode.length != 4) {
                    errMsgEl.text("请输入4位验证码!");
                    errMsgEl.show();
                    checkCodeEle.focus();
                    switchBtn();
                    b = false;
                    return;
                }
               $.post('${base}/user/login.html',{'username':username,'password':password,"checkCode":checkCode},function(data,textStatus) {
                 $("#load").remove();
                 if(data.result==5) {
                   window.location.href="${base}/uc/home.html";
                 } else if(data.result == 8) {
                     window.location.href="${base}/uc/changeInitPwd.html";
                 } else {
                   if(data.result=="3") {
                           $("#checkImg").trigger("click");
                           $("#checkCode").val("");
                   }
                   errMsgEl.text(data.msg);
                   errMsgEl.show();
                   switchBtn();
                 }
                     b = false;
               },"json");
             } else {
               alert("正在登陆,请稍后...");
             }    
         });
})
$(document).keyup(function(event) {
  if(event.keyCode==13) {
     $("#submitForm").trigger("click");
  }
});
</script>
</head>
<body>
[#include "/uc/include/loginHead.html" /]
<div class="cont">
  <div class="cont_left"></div>
  <div class="cont_right">
    <h2>欢迎登录</h2>
    <div class="dluser">
      <input class="dluser_txt" name="" type="text"  id="username" />
    </div>
    <div class="dluser">
      <input class="dluser_txt font_666" name="" type="text"  id="passwordText" value="密码"/>
      <input class="dluser_txt" name="" type="password"  id="password" style="display:none;"/>
    </div>
    <div class="dluser">
      <input class="dluser_yzm" name="" type="text"  id="checkCode" /><img width="100" id="checkImg" height="30" style="padding-bottom: 2px;" id="validatecode" align="absmiddle" title="更换新的验证码" src="Kaptcha.validatecode" onclick="this.src=Math.floor(Math.random()*0x10000) + '.validatecode'"/>
    </div>
    <div id="errMsgU" style=" margin-bottom:17px; border:1px solid #ccc; padding:10px 8px;width:280px; color:#f00;display:none;"></div>
     <!-- <div class="dluser"> <span><a href="#">忘记密码?</a></span>
      <input class="dluser_ck" type="checkbox" />
      <label>自动登录</label>
    </div> --> 
    <div class="dluser">
      <input class="dluser_btn" name="" type="button" id="submitForm"/>
      <input class="dluser_btn greyloginbtn" name="" type="button" id="logining" style="display:none;"/>
      
      <font><a href="${base}/user/findPwd.html">忘记密码?</a></font> </div>
   
  </div>
  <div class="clear"></div>
</div>
<div class="clear"></div>
[#include "/uc/include/loginFoot.html" /]
</body>
</html>