login.jsp 4.9 KB
<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="login.title"/></title>
    <meta name="menu" content="Login"/>
</head>
<body id="login">

<form method="post" id="loginForm" action="<c:url value='/j_security_check'/>"
      onsubmit="saveUsername(this);return validateForm(this)" class="form-signin" autocomplete="off">
    <h3 class="form-title">
        <fmt:message key="login.heading"/>
    </h3>
    <c:if test="${param.error != null}">
        <div class="alert alert-danger alert-dismissable">
            <fmt:message key="errors.password.mismatch"/>
        </div>
    </c:if>
    <div class="form-group">
        <div class="input-group">
            <input type="text" name="j_username" id="j_username" class="form-control form-control-solid placeholder-no-fix"
            placeholder="<fmt:message key="label.username"/>" required tabindex="1" style="background-image: none;">
            <span class="input-group-addon" id="j_username_icon"><i class="fa fa-keyboard-o"></i></span>
        </div>
    </div>
    <div class="form-group">
        <div class="input-group">
        <input type="password" class="form-control form-control-solid placeholder-no-fix" name="j_password" id="j_password" tabindex="2"
           placeholder="<fmt:message key="label.password"/>" required style="background-image: none;">
            <span class="input-group-addon" id="j_password_icon"><i class="fa fa-keyboard-o"></i></span>
        </div>
    </div>

    <div class="form-actions">
        <button type="submit" class="btn btn-success uppercase" name="login" tabindex="4">
            <fmt:message key='button.login'/>
        </button>
        <c:if test="${appConfig['rememberMeEnabled']}">
            <label for="rememberMe" class="rememberme check">
            <input type="checkbox" name="_spring_security_remember_me" id="rememberMe" tabindex="3"/>
            <fmt:message key="login.rememberMe"/></label>
        </c:if>
    </div>
</form>

<%--<p>--%>
    <%--<fmt:message key="login.signup">--%>
        <%--<fmt:param><c:url value="/signup"/></fmt:param>--%>
    <%--</fmt:message>--%>
<%--</p>--%>

<c:set var="scripts" scope="request">
    <script src="${ctx}/scripts/login.js?id=1"></script>
    <script>
        $(document).ready(function() {

            $('#j_username').keyboard({
                        openOn : null,
                        stayOpen : true,
                        layout : 'qwerty'
                    });

            $('#j_username_icon').click(function(){
                var kb = $('#j_username').getkeyboard();
                // close the keyboard if the keyboard is visible and the button is clicked a second time
                if (kb.isOpen ) {
                    kb.close();
                } else {
                    kb.reveal();
                }
            });

            $('#j_password').keyboard({
                openOn : null,
                stayOpen : true,
                layout : 'qwerty'
            });

            $('#j_password_icon').click(function(){
                var kb = $('#j_password').getkeyboard();
                // close the keyboard if the keyboard is visible and the button is clicked a second time
                if (kb.isOpen ) {
                    kb.close();
                } else {
                    kb.reveal();
                }
            });
        });
    </script>
</c:set>

<%--<p><fmt:message key="login.passwordHint"/></p>--%>

<%--<p><fmt:message key="updatePassword.requestRecoveryTokenLink"/></p>--%>

<!--
<script type="text/javascript" src="/scripts/jquery-2.1.4.js"/>
<script type="text/javascript">
    function test() {
        alert("this is test");
    }

    $("#j_username").change(
            function loginOnChange() {
                //alert($('#j_username').val());
                $.ajax({
                    type: 'GET',
                    contentType: 'application/json',
                    url: 'a/checkExists/loginName/' + $('#j_username').val(),
                    dataType: 'json',
                    success: function (data) {
                        if (data && data.exists) {
                            //$('log_tip_div').style.display = "inline";
                            $('form-signin-heading').innerHTML = "该用户名已经被使用";
//                            canSub = false;
//                            loginUserError = true;
//                            isLoginUserExists = true;
                        } else {
                            //log_tip_div.style.display = "inline";
                            $('form-signin-heading').innerHTML = "用户名可以使用";
//                            canSub = true;
//                            loginUserError = false;
//                            isLoginUserExists = true;
                        }
                    },

                    error: function () {
                        alert("check user error");
                    }

                });
            })
</script>
-->
</body>