login.html 3.9 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登陆</title>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/login.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/mask.css">
</head>

<body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false">
    <!--头部  -->
    <include file="public@header" />
    <main>
        <!--彈出框-->
        <div class="mask">

        </div>
        <div class="container">
            <div class="login">
                <div class="login_left">
                    <img src="__TMPL__/public/assets/starImg/aicon_88.png" alt="">
                </div>
                <div class="login_right">
                    <!--登陆方式-->
                    <div class="login_right_nav clearfix">
                        <!-- third 第三方登陆-->
                        <div class="login_right_nav_third">
                            <a href="/portal/login/thirdLogin">其他登录方式</a>
                        </div>
                        <!--手机号登陆-->
                        <div class="login_right_nav_phone login_nav_active">
                            <a href="/portal/login/login">手机号登录</a>
                        </div>
                    </div>
                    <!--登陆-->
                    <div class="login_right_main">
                        <form action="">
                            <!--手机号-->
                            <div class="login_right_main_phone">
                                <input type="tel" placeholder="请输入手机号" id="mobile">
                            </div>
                            <!--密码-->
                            <div class="login_right_main_pswd">
                                <input type="password" placeholder="请输入密码" id="password">
                            </div>
                            <!--注册-->
                            <div class="login_right_main_reg">
                                没有账号?
                                <a href="/portal/login/register">
									立即注册
								</a>
                            </div>
                            <!--登陆-->
                            <button class="logging" type="button">登录</button>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </main>
    <div class="Keep">
        Copyright © 2004-2019 独角星球 版权所有
    </div>
    <script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
    <script src="__TMPL__/public/assets/js/public.js"></script>
    <script>
        $('.logging').click(function() {
            var phone_number = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
            var mobile = $("#mobile").val();
            var password = $.trim($('#password').val());
            if (!phone_number.test(mobile)) {
                mask("手机号格式有误");
                return false;
            }
            if (password == '') {
                mask("密码不能为空");
                return false;
            }
            $.ajax({
                type: 'POST',
                url: "/portal/login/loginCommit",
                data: {
                    'mobile': mobile,
                    'user_pass': password
                },
                dataType: 'json',
                success: function(data) {
                    if (data.code == 1) {
                        mask(data.msg);
                        window.location.href = '/';
                    } else {
                        mask(data.msg);
                    }
                }
            });
        });
    </script>
</body>

</html>