<html ng-app='login-app'>

<head>
    <meta name="renderer" content="webkit" />
    <meta name="force-rendering" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <title>图书馆电子资源远程访问云系统</title>
    <link href="/polyinfowebvpn/layoutHomeFont/iconfont.css" rel="stylesheet" />
    <link rel="stylesheet" href="/polyinfowebvpn/plugins/amaze/css/amazeui.min.css" />
    <link rel="stylesheet" href="/polyinfowebvpn/plugins/amaze/css/admin.css" />
    <link rel="stylesheet" href="/polyinfowebvpn/plugins/amaze/css/admin_login.css" />
    <link rel="stylesheet" href="/polyinfowebvpn/css/layui.css" media="all">
    <script src="/polyinfowebvpn/js/jquery.min.js"></script>
    <script>
        (function () {
            if (window.location !== window.top.location) {
                location.href = '/iframe'
            }
            var sUserAgent = navigator.userAgent;
            if ((sUserAgent.indexOf('Linux') != -1 && sUserAgent.indexOf('XiaoMi') != -1) || (sUserAgent.toLowerCase().indexOf("safari") != -1 && sUserAgent.indexOf('iPad') > -1) || /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) || sUserAgent.indexOf('Android') > -1 || sUserAgent.indexOf('iOS') > -1 || sUserAgent.indexOf('iPhone') > -1 || sUserAgent.indexOf('iPad') > -1 || sUserAgent.indexOf('iPod') > -1 || sUserAgent.indexOf('Symbian') > -1) {
                window.open('/login_h5', "_self")
            }
            function GetQueryString(name) {
                if (window.location.search != undefined && window.location.search != "" && window.location.search.indexOf(name) != -1) {
                    return window.location.search.split('?' + name + '=')[1]
                } else {
                    return null;
                }
            }
            $.ajax({
                url: '/api/acl_ipInterval/ipLogins',
                type: 'post',
                data: { "type": "" },
                success: function (data) {
                    if (data.code == 200) {
                        var url = GetQueryString("url")
                        if (url != '' && url != null) {
                            $(location).attr('href', url);
                        }
                    }
                }
            })
            // 天大需求 登录成功以后返回到跳转点击进入的接口
            var url = GetQueryString("url");
            console.log(url)
            if (url != null && url.indexOf("https:") != -1 || url != null && url.indexOf("http:") != -1) {
                if (url.indexOf("www.mtxy.edu.cn") != -1) {

                } else {
                    if (url.indexOf(window.location.origin + '/') > -1) {

                    }
                    url.replace(window.location.origin + '/pis', window.location.origin + '/-----https://')
                    url.replace(window.location.origin + '/pip', window.location.origin + '/-----http://')
                    localStorage.setItem('openurl', url);
                }
            }
        })();
        sessionStorage.setItem('SCHOOLNAME', "");
    </script>

    <script src="/polyinfowebvpn/plugins/amaze/js/amazeui.min.js"></script>
</head>

<body ng-controller="loginCtrl" class="login" style="display:none">
    <input type="hidden" value="false" id="perms">
    <div class="am-g login_body_box">
        <div class="head_box">
            <img ng-src="/polyinfowebvpn/image/schoollogo/[[limg]]" alt="" err-src="/polyinfowebvpn/image/logo.png">
            <span>电子资源远程访问云系统</span>
        </div>

        <div id="loading" style="display:none">
            <span style="right: 5px;top: -5px;" class="close" onclick="closeMsg()">X</span>
            <span style="color:red;font-weight:bolder;font-size:22px;">温馨提示</span>
            <span style="color: aliceblue;">用户您好,网站页面已更新升级(用户名密码不变)</span>
            <span style="color: aliceblue;">倒计时 <spam id="down"></spam>秒后关闭！</span>
        </div>

        <div id="loadings" style="display:none">
            <form method="post" class="am-form" ng-class="{active: onpassword==true}" autocomplete="off">
                <span style="right: 5px;top: 5px;" class="close" onclick="closeMsg()">X</span>
                <div class="name_box">
                    <span class="iconfont icon-suo"></span>
                    <input type="password" placeholder="新密码" autocomplete="off" ng-model="loginDatas.oldPassword"
                        id="password" value="">
                </div>
                <div class="name_box">
                    <span class="iconfont icon-suo"></span>
                    <input type="password" placeholder="再次输入新密码" autocomplete="off" ng-model="loginDatas.newPassword"
                        id="password" value="">
                </div>
                <div class="am-cf name_box">
                    <div ng-click="newSubmit()" class="update-btn">确认修改</div>
                </div>
                <input type="hidden" ng-model="csrfToken" value="" name="csrfToken">
            </form>
            <span style="margin-top:-1%;color:red">由于您第一次登录系统，请修改密码后登录！
                <br>密码格式：数字、大小写字母、特殊符号，密码长度不小于8位
            </span>
        </div>

        <div class="am-u-lg-3 am-u-md-3 am-u-sm-centered login_body bor-r">
            <div class="submit-type" ng-show='flagPassword'>
                <div ng-click="password()" ng-class="{active:background_password==true}">账号密码登录</div>
                <div ng-click="judgeFinances()" ng-class="{active:background_judgeFinances==true}" class="border-left">
                    统一身份认证登录</div>
            </div>
            <div class="submit-type" ng-show='flagOther'>
                <div class="" ng-class="{active: onWXCode==true}" ng-click='toWeiXinCode()'>微信验证登录</div>
                <div class="" ng-class="{active: onWX==true}" ng-click='toWeiXin()'>微信扫码登录</div>
                <div class="" ng-class="{active: onphone==true}" ng-click='tophone()'>短信验证登录</div>
            </div>
            <form ng-show='flag' method="post" class="am-form" ng-class="{active: onpassword==true}" autocomplete="off">
                <div class="name_box">
                    <label for="text">手机号:</label>
                    <input type="text" name="account" ng-model="phone" class="phoneCode" id="email" value="">
                </div>
                <div class="name_box mycanvas_box">
                    <label for="password">验证码:</label>
                    <input type="text" ng-model="phoneCode" id="verificationCode" value="" style="width: 30%;">
                    <span id="send" style="width:19%;height:30px" ng-click="send()"></span><br />
                    <span class="phoneCodeMessage">[[resultText]]</span>
                    <span id="sendMo"></span>
                </div>
                <div class="am-cf name_box height">
                    <input type="submit" id="loginBtn" name="" value="登 录" ng-click="newPhoneSubmit()"
                        class="am-btn am-btn-primary am-btn-sm am-fr">
                </div>
                <input type="hidden" ng-model="csrfToken" value="" name="csrfToken">
                <div class="am-cf name_box loginBtn">
                    <span ng-click="toLogin(true)">账号密码登录</span>
                </div>
            </form>
            <form ng-show='flagWX' method="post" class="am-form" ng-class="{active: onpassword==true}"
                autocomplete="off">

                <div class="name_box">
                    <label for="text">手机号:</label>
                    <input type="text" name="account" class="phoneCode QRcode" id="email" value="">
                </div>
                <div class="am-cf name_box height">
                    <input type="submit" id="loginBtn" name="" value="点击出码"
                        class="am-btn am-btn-primary am-btn-sm am-fr getQRcode">
                </div>
                <input type="hidden" ng-model="csrfToken" value="" name="csrfToken">
                <div class="am-cf name_box loginBtn">
                    <span ng-click="toLogin(true)">账号密码登录</span>
                </div>
            </form>
            <form ng-show='flagWXCode' method="post" class="am-form" ng-class="{active: onpassword==true}"
                autocomplete="off">
                <div class="name_box">
                    <label for="text">手机号:</label>
                    <input type="text" name="account" ng-model="phone" class="codePhone" id="email" value="">
                </div>
                <div class="name_box mycanvas_box">
                    <label for="password">验证码:</label>
                    <input type="text" class="wxCodeVal" id="verificationCode" value="" style="width: 30%;">
                    <span id="send" style="width:19%;height:30px" class="send">发送验证码</span><br />
                    <span class="phoneCodeMessage">[[resultText]]</span>
                    <span id="sendWXMo"></span>
                </div>
                <div class="am-cf name_box height">
                    <input type="submit" id="loginBtn" name="" value="登 录"
                        class="am-btn am-btn-primary am-btn-sm am-fr WXCode">
                </div>
                <input type="hidden" ng-model="csrfToken" value="" name="csrfToken">
                <div class="am-cf name_box loginBtn">
                    <span ng-click="toLogin(true)">账号密码登录</span>
                </div>
            </form>
            <form method="post" class="am-form flagPassword" ng-class="{active: onpassword==true}"
                ng-show='flagPassword' autocomplete="off">

                <div class="name_box">
                    <div>
                        <span class="iconfont icon-huabanfuben islogin"></span>
                        <input type="text" placeholder="学工号" name="account" ng-model="loginData.account" id="email"
                            value="">
                    </div>
                </div>
                <div class="name_box">
                    <div>
                        <span class="iconfont icon-suo islogin"></span>
                        <input type="password" placeholder="密码" ng-model="loginData.accountPd" autocomplete="off"
                            name="accountPd" id="password" value="">
                    </div>
                </div>
                <div class="name_box mycanvas_box">
                    <div>
                        <span class="iconfont icon-yijianshouquan islogin"></span>
                        <input type="text" placeholder="验证码" ng-model="loginData.verificationCode" id="verificationCode"
                            value="">
                        <div class="imgContainer">
                            <img id="imagess" onclick="getcodeimgs()" alt="" height="30px">
                        </div>
                        <br />
                        <span class="verificationCodeMessage">点击图片刷新验证码</span>
                    </div>

                </div><br>
                <input type="hidden" ng-model="csrfToken" value="" name="csrfToken">
                <div class="am-cf name_box height">
                    <div>
                        <input type="submit" id="loginBtn" name="" value="登 录" ng-click="loginSubmit()"
                            class="am-btn am-btn-primary am-btn-sm" i18n="i18n.login">
                    </div>

                </div>
                <div class="am-cf name_box loginBtn">
                    <span
                        class="color-000">没有账号？</span>&nbsp;<span ng-click="register()">立即注册</span>
                </div>
            </form>

        </div>
        <div class="help_box bor-r">
            <h2>温馨提示</h2>
            <span>
                1、请用已经激活的中南财经政法大学统一身份认证的用户和密码（办公网/选课系统账号密码）登录后按需访问电子资源（过量下载会暂停使用本系统）。<br />
                2、若您的账号尚未激活，请先访问中南财经政法大学统一身份认证系统激活后再访问。<br />
                3、如果您确信输入的账号密码无误，仍提示您“用户名密码错误”，请登录中南财经政法大学
                <a href="http://ids.zuel.edu.cn/authserver/login">统一身份认证系统</a>，修改密码后即可正常登录。
            </span>
        </div>

    </div>
    <div class="am-modal am-modal-confirm" tabindex="-1" id="login_content">
        <div class="am-modal-dialog am-modal-dialog-delete">
            <div class="am-modal-hd am-modal-head">登录提示<span class="am-modal-close am-modal-btn"
                    data-am-modal-cancel></span></div>
            <div class="am-modal-bd">
                您上次非正常退出或您的账号已经在其他地方登录，是否继续登录？
            </div>
            <div class="am-modal-footer">
                <input class="am-modal-btn false" data-am-modal-cancel value="否" ng-click="cancel()">
                <input class="am-modal-btn" data-am-modal-confirm value="是" ng-click="submit()">
            </div>
        </div>
    </div>
    <div class="am-modal am-modal-confirm" tabindex="-1" id="register_content">
        <div class="registerContent bc-white am-modal-dialog">
            <div class="am-modal-hd am-modal-head">账号注册<span class="am-modal-close am-modal-btn"
                    data-am-modal-cancel></span></div>
            <div>
                <span class="iconfont icon-huabanfuben"></span>
                <input type="text" ng-model="registerData.account" id="accountRegister" placeholder="请输入学工号">
            </div>
            <div>
                <span class="iconfont icon-suo"></span>
                <input type="password" ng-model="registerData.password" id="passwordRegister" autocomplete="off"
                    placeholder="请输入密码(长度为8-20)">
            </div>
            <div>
                <span class="iconfont icon-suo"></span>
                <input type="password" ng-model="registerData.newpassword" id="newpasswordRegister" autocomplete="off"
                    placeholder="请再次输入密码">
            </div>
            <div>
                <span class="iconfont icon-200yonghu_yonghu"></span>
                <input type="text" ng-model="registerData.name" id="nameRegister" placeholder="请输入姓名">
            </div>
            <div>
                <span class="iconfont icon-shouji1"></span>
                <input type="text" ng-model="registerData.phone" id="phoneRegister" placeholder="请输入手机号码">
            </div>
            <div>
                <span class="iconfont icon-youjian"></span>
                <input type="text" ng-model="registerData.email" id="emailRegister" placeholder="请输入邮箱">
            </div>
            <div style="color: red;text-align:left;padding-left:50px">
                注*:以上除手机号以外内容不能为空
            </div>
            <div>
                <div class="registerBtn" ng-click="submitRegister()">注册</div>
            </div>
        </div>
    </div>
    <div class="am-modal am-modal-confirm" tabindex="-1" id="user_content">
        <div class="registerContent bc-white am-modal-dialog">
            <div class="am-modal-hd am-modal-head">重置密码<span class="am-modal-close am-modal-btn"
                    data-am-modal-cancel></span></div>
            <div>
                <span class="iconfont icon-huabanfuben"></span>
                <input type="text" ng-model="userData.account" placeholder="请输入学工号">
            </div>
            <div>
                <span class="iconfont icon-youjian"></span>
                <input type="text" ng-model="userData.email" placeholder="请输入邮箱">
            </div>
            <div class="mycanvas_box">
                <span class="iconfont icon-200yonghu_yonghu"></span>
                <input type="text" ng-model="userData.code" placeholder="请输入邮箱验证码">
                <span class="imgContainer emailcode" ng-click="getemailcode()">获取验证码</span>
                <span class="imgContainer emailcodem" id="emailcodem"></span>
            </div>
            <div>
                <span class="iconfont icon-suo"></span>
                <input type="password" ng-model="userData.pasdold" autocomplete="off" placeholder="请输入密码(长度为8-20)">
            </div>
            <div>
                <span class="iconfont icon-suo"></span>
                <input type="password" ng-model="userData.pasd" autocomplete="off" placeholder="请再次输入密码">
            </div>
            <div style="padding: 0 50px; color: red;text-align: left">
                密码格式：数字、大小写字母、特殊符号，密码长度不小于8位
            </div>
            <div>
                <div class="registerBtn" ng-click="submitUser()">重置</div>
            </div>
        </div>
    </div>
    <div class="am-modal am-modal-confirm alert" tabindex="-1" id='onadd'>
        <div class="am-modal-dialog am-modal-dialog-delete">
            <div class="am-modal-hd am-modal-head">成功提示</div>
            <div class="am-modal-bd">
                注册成功,待管理员审核
            </div>
            <div class="am-modal-footer">
                <input class="am-modal-btn" value="确定">
            </div>
        </div>
    </div>
    <div class="am-modal am-modal-confirm alert" tabindex="-1" id='onemail'>
        <div class="am-modal-dialog am-modal-dialog-delete">
            <div class="am-modal-hd am-modal-head">成功提示</div>
            <div class="am-modal-bd">
                邮件发送成功！
            </div>
            <div class="am-modal-footer">
                <input class="am-modal-btn" value="确定">
            </div>
        </div>
    </div>
    <input type="hidden" value="http://222.39.6.170:8081/smsLogin" id="baseUrl">
    <input type="hidden" value="" id="token">

</body>

</html>
<style scoped>
    .registerContent .am-modal-close.am-modal-btn {
        background-image: url('/polyinfowebvpn/image/config_login_close.png');
        top: 3px;
    }

    .border {
        margin: 0 20px;
        border-bottom: 2px solid #fff;
    }

    .registerContent>div {
        position: relative;
    }

    .registerContent .iconfont {
        font-size: 18px;
        font-weight: 600;
        position: absolute;
        top: 12px;
        left: 55px;
    }

    .registerContent input::-webkit-input-placeholder {
        color: #999;
    }

    .imgContainer {
        width: 90px;
        height: 30px;
        display: inline-block;
        position: absolute;
        right: 10px;
        top: 5px;
        border-radius: 20px;
        overflow: hidden;

    }

    .emailcode {
        background-color: #265CFF;
        color: #fff;
        right: 50px;
        line-height: 30px;
        cursor: pointer;
    }

    .emailcodem {
        z-index: 99;
        background-color: rgba(0, 0, 0, .5);
        display: none;
        color: #fff;
        right: 50px;
        line-height: 30px;
    }

    .verificationCodeMessage {
        color: #b7b3b3;
        float: right;
    }

    .phoneCodeMessage,
    .sendCode {
        color: red;
        float: right;
        margin-right: 19%;
    }

    .loginBtn {
        color: #0D71EB;
        cursor: pointer;
    }

    .update-btn {
        margin-top: 10px;
        border-radius: 20px;
        background-color: #0D71EB;
        height: 40px;
        line-height: 40px;
        text-align: center;
    }

    .mycanvas_box {
        position: relative;
    }

    .height {
        height: 35px;
    }

    #mycanvas,
    #send {
        position: absolute;
        top: 1px;
        left: 62%;
    }

    @media screen and (max-width: 1366px) {

        #phoneCodeMessage,
        #send {
            width: 23% !important;
        }

        .phoneCode#email {
            width: 54% !important;
        }
    }

    .islogin {
        position: absolute;
        top: 11px;
        left: 5px;
        font-weight: 600;
        font-size: 18px;
    }

    #send {
        top: 1px;
        line-height: 30px;
        text-align: center;
        color: #fff;
        cursor: pointer;
        background-color: #ff8000;
    }

    .name_box>div {
        width: 280px;
        position: relative;
    }

    #sendMo,
    #sendWXMo {
        color: #000;
        font-weight: 500;
        line-height: 30px;
        text-align: center;
        position: absolute;
        top: 1px;
        left: 62%;
        z-index: 9;
        background-color: #ccc;
        opacity: .7;
        width: 19%;
        height: 30px
    }

    .am-btn.am-round {
        border-radius: 0;
        height: 40px;
        line-height: 8px;
        color: #fff;
        background: #0D71EB;
        border: none;
    }

    .user_role {
        position: absolute;
        top: 15px;
        right: -210px;
        z-index: 99;
        width: 225px;
    }

    .am-btn.am-round {
        border-radius: 20px;
        height: 40px;
        line-height: 40px;
        color: #fff;
        background: #0D71EB;
        padding: 0 10px;
        margin: 5px;
        border: none;
        font-size: 14px;
    }

    .color-000 {
        color: #000;
    }

    #register_content input:focus,
    #user_content input:focus {
        outline: none;
        border-bottom: 1px solid #0D71EB;
    }

    #register_content input,
    #user_content input {
        outline: none;
        border: 0px;
        border-bottom: 1px solid #b7b3b3;
    }

    #register_content .sex {
        display: flex;
        justify-content: center;
    }

    #register_content input,
    #user_content input {
        padding: 0;
        width: 300px;
        font-size: 15px;
        padding-left: 35px;
        height: 40px;
        margin-bottom: 10px;
    }

    .registerBtn {
        background-color: #0D71EB;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        border-radius: 20px;
        width: 300px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        margin-left: 50px;
        margin-top: 20px;
    }


    .registerContent {
        width: 400px;
        height: 450px;
        text-align: center;
    }

    .bc-white {
        background-color: #fff;
    }

    .registerContent .title {
        padding-left: 15px;
        text-align: left;
    }

    .registerContent label {
        color: #666;
        width: 16%;
    }

    .submit-type div.active {
        color: #0D71EB;
        border-bottom: 3px solid #0D71EB;
    }

    .jxget {
        display: flex;
        flex-direction: column;
        text-align: right;
        padding-right: 20px;

    }

    .jxgetall,
    .jxgetIp {
        color: #fff;
        cursor: pointer;
    }

    /*关闭图标*/
    .close {
        position: absolute;
        margin: 3px;
        width: 24px;
        height: 24px;
        cursor: pointer;
        box-sizing: border-box;
    }

    .close:hover {
        color: red;
    }

    .jxgetIp:hover,
    .jxgetall:hover {
        color: red;
    }

    #loading {
        color: #fff;
        width: 40%;
        height: 20%;
        border: 3px solid #C3DAF9;
        position: absolute;
        text-align: center;
        top: 34%;
        left: 25%;
        z-index: 10000;
        background-color: #59a3e4;
        line-height: 25px;
        vertical-align: middle;
        font-size: 11pt;
        display: none;
        display: flex;
        align-items: center;
        justify-content: space-around;
        flex-direction: column;
        padding: 30px 0px;
    }

    #loadings .am-form {
        margin-top: 15px;
    }

    #loadings .close {
        color: #0D71EB;
    }

    #loadings .iconfont {
        position: absolute;
        font-weight: 600;
        font-size: 18px;
        color: #000;
        left: 7px;
        top: 7px;
    }

    #loadings .name_box {
        position: relative;

    }

    #loadings {
        color: #fff;
        width: 420px;
        height: 250px;
        position: absolute;
        top: 30%;
        left: 40%;
        z-index: 10000;
        background-color: #fff;
        line-height: 25px;
        vertical-align: middle;
        font-size: 11pt;
        display: none;
        display: flex;
        align-items: center;
        justify-content: space-around;
        flex-direction: column;
    }

    .login_body_box {
        position: relative;
        height: 100%;
    }

    .bor-r {
        border-radius: 20px;
    }

    h2 {
        color: #fff;
        text-align: center;
        border-bottom: 1px solid #999;
        padding-bottom: 10px;
        background: transparent;
        font-weight: 400;
        font-size: 18px;
        margin: 0 20px 0px 20px;
    }

    .otherschool {
        margin: 0 20px 15px 20px;
    }

    .head_box {
        padding: 10px 10%;
        background-color: rgba(16, 0, 64, .25);
        display: flex;
        align-items: center;
    }

    .head_box img {
        height: 60px;
        margin-right: 20px;
    }

    .head_box span {
        font-size: 24px;
        color: #fff;
    }

    .header p {
        font-size: 14px;
    }

    /*.am-cf span {
        color: #fff;
    }*/

    label {
        width: 32%;
        text-align: right;
        line-height: 30px;
        color: #fff;
    }

    #email,
    #password,
    #ldap,
    #verificationCode {
        width: 280px;
        border-bottom: 1px solid #b7b3b3;
        height: 40px;
        display: inline-block;
        padding-left: 35px;
    }

    #verificationCode {
        padding-right: 110px;
    }

    #loginBtn {
        width: 280px;
    }

    @media screen and (max-width: 1500px) {}

    .am-form-ldap,
    .am-form-password {
        display: none;
    }

    .am-form-ldap.active,
    .am-form-password.active {
        display: block;
    }

    .name_box {
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }

    .am-form {
        margin-top: 30px;
    }

    .am-form input[type=text],
    .am-form input[type=password] {
        font-size: 15px;
        border: 0px;
    }

    .f_box {
        text-align: center;
        position: fixed;
        left: 50%;
        width: 100%;
        margin-left: -50%;
        bottom: 0;
        color: #333;
    }

    .login_body.am-u-sm-centered {
        height: 380px;
        position: absolute;
        top: 50%;
        margin-top: -180px;
        background-color: #fff;
    }

    .login_body.am-u-sm-centered {
        width: 25%;
        position: absolute;
        right: 12%;
    }

    .am-modal-head {
        height: 40px;
        line-height: 40px;
        padding: 0;
        text-align: center;
        color: #0D71EB;
        background: none;
        background-color: #fff;
        font-size: 16px;
        font-weight: 600;
        padding-left: 0px;
    }

    .am-fr {
        float: none;
        position: absolute;
        left: 50%;
        margin-left: -40px;
        width: 80px;
    }

    .toOther {
        margin-bottom: 5px;
    }

    #loginBtn {
        background-color: #0D71EB;
        border-color: #0D71EB;
        outline: none;
        -webkit-appearance: none;
        border: none;
        border-radius: 20px;
        height: 40px;
        font-size: 15px;
    }


    .help_box {
        padding: 20px;
        color: #fff;
        position: absolute;
        left: 12%;
        height: 380px;
        top: 50%;
        margin-top: -180px;
        font-size: 14px;
        width: 50%;
        background-color: rgba(16, 0, 64, 0.25);
    }

    .help_box span {
        display: block;
        line-height: 34px;
        padding: 0px 37px;
    }

    .help_box a {
        font-weight: bold;
        color: #ffe000;
    }

    .submit-type {
        display: flex;
        justify-content: space-evenly;
        font-size: 18px;
        font-weight: 500;
        color: #b1b1b1;
        height: 60px;
    }

    .submit-type div {
        height: 100%;
        text-align: center;
        line-height: 60px;
    }

    .submit-type div:hover {
        cursor: pointer;
    }

    .submit-type .active span {
        background-color: #fbeb05;
    }
</style>


<script src="/polyinfowebvpn/js/jquery.min.js"></script>
<script src="/polyinfowebvpn/js/angular.min.js"></script>
<script src="/polyinfowebvpn/js/public.js"></script>
<script src="/polyinfowebvpn/plugins/amaze/js/amazeui.min.js"></script>
<script src="/polyinfowebvpn/js/base64.js"></script>
<script src="/polyinfowebvpn/js/layui.all.js" charset="utf-8"></script>
<script src="/polyinfowebvpn/js/jquery.i18n.properties.js"></script>
<script>
    // 默认语言 翻译
    var defaultLang = "cn"
    function languageSelect(defaultLang) {
        $("[i18n]").i18n({
            defaultLang: defaultLang,
            filePath: "./i18n/",
            filePrefix: "i18n_",
            fileSuffix: "",
            forever: true,
            callback: function (res) { }
        });
    }
    languageSelect(defaultLang);
    var rest = document.getElementById("spanmsg");
    var resmsg = "";
    $.ajax({
        url: '/api/acl_logintypecode/getListAll',
        type: 'post',
        success: function (data) {
            if (data.code == 200 && data.result.length) {
                for (var i = 0; i < data.result.length; i++) {
                    data.result[i].name = (i + 1) + "." + data.result[i].name;
                    resmsg = resmsg + data.result[i].name + "</br>";
                }
                rest.innerHTML = resmsg;
            }
        }
    });
    var flagA = false;
    $.ajax({
        url: '/api/acl_ipInterval/ipLogins',
        type: 'post',
        data: { "type": "" },
        success: function (data) {
            if (data.code == 200) {
                flagA = true;
                localStorage.removeItem('LoginData')
                sessionStorage.setItem('ipLoginData', JSON.stringify(data))
                $(location).attr('href', '/');
            } else {
                $.ajax({
                    url: '/api/acl_user/authenticVerification',
                    type: 'post',
                    success: function (data) {
                        if (data.code == 200) {
                            function GetQueryString(name) {
                                //  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                                // var r = window.location.search.substr(1).match(reg);
                                // if (r != null) return unescape(r[2]); return null;
                                if (window.location.search != undefined && window.location.search != "" && window.location.search.indexOf(name) != -1) {
                                    return window.location.search.split('?' + name + '=')[1]
                                } else {
                                    return null;
                                }
                            }
                            //登录成功以后返回到跳转点击进入的接口
                            var url = GetQueryString("url");
                            if (url != null && url != "") {
                                if (url.indexOf("www.mtxy.edu.cn") != -1) {
                                } else {
                                    url.replace(window.location.origin + '/pis', window.location.origin + '/-----https://')
                                    url.replace(window.location.origin + '/pip', window.location.origin + '/-----http://')
                                    localStorage.setItem('openurl', url);
                                }
                            }
                            if (url == null || url == "") {
                                if (window.location.href.indexOf("/login") == -1) {
                                    if (window.location.pathname != undefined && window.location.pathname != "" && window.location.pathname.indexOf("/s/") == 0 || window.location.pathname.indexOf("/p/") == 0) {
                                        let url = window.location.href
                                        url.replace(window.location.origin + '/pis', window.location.origin + '/-----https://')
                                        url.replace(window.location.origin + '/pip', window.location.origin + '/-----http://')
                                        localStorage.setItem('openurl', url);
                                    } else {
                                        let url = window.location.href
                                        url.replace(window.location.origin + '/pis', window.location.origin + '/-----https://')
                                        url.replace(window.location.origin + '/pip', window.location.origin + '/-----http://')
                                        localStorage.setItem('openurl', url);
                                    }
                                }
                            }
                            if (data.name == "dbsf") {
                                // 东北师范大学对接登录
                                function GetQueryString(name) {
                                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                                    var r = window.location.search.substr(1).match(reg);
                                    if (r != null) return unescape(r[2]); return null;
                                }
                                var url = GetQueryString("url")
                                window.open(data.url, "_self");
                            } else if (data.name == "cslg") {
                                window.open(data.url, "_self");
                            }
                            else if (data.name == "dbly") {
                                window.open(data.url, "_self");
                            } else if (data.name == "tjdx") {
                                function GetQueryString(name) {
                                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                                    var r = window.location.search.substr(1).match(reg);
                                    if (r != null) return unescape(r[2]); return null;
                                }
                                var url = GetQueryString("url");
                                if (url == null) {
                                    window.open(data.url, "_self")
                                } else {
                                    window.open(data.url, "_self")
                                }
                            } else if (data.name == "nzxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "nxdx") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "cqkj") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hjj" && false) {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hljzyy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "sjxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "shsf") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hgd") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "nmgny") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "mtxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "scwy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zdhs") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "bd") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zncj") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "qtxy") {
                                function GetQueryString(name) {
                                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                                    var r = window.location.search.substr(1).match(reg);
                                    if (r != null) return unescape(r[2]); return null;
                                }
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "xnykdx") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "sky") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "skyxnwg") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zdhsnwwg") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else {
                                if (data != undefined && data.name != undefined && data.status != undefined && data.status == "true" && data.url != undefined && data.url != "") {
                                    var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                                }
                                $(".login").attr("style", "display:block!important");
                                if (localStorage.getItem('lgimg') && localStorage.getItem('lgimg') != "") {
                                    $('body.login').css('background-image', 'url(/polyinfowebvpn/image/schoollogo/' + localStorage.getItem("lgimg") + ')')
                                }
                            }
                        }
                    }
                });

            }
        }
    });
    var app = angular.module('login-app', []);
    // { { !--由于express hbs 与angular 冲突，修改 angular的语法{ { } } 为[[]]-- } }
    app.config(function ($interpolateProvider) {
        $interpolateProvider.startSymbol('[[');
        $interpolateProvider.endSymbol(']]');
    });
    app.directive("errSrc", function () {
        return {
            link: function (scope, element, attrs) {
                element.bind("error", function () {
                    if (attrs.src != attrs.errSrc) {
                        attrs.$set("src", attrs.errSrc);
                    }
                });
            }
        }
    });
    app.filter("title_filter", function () {
        var filterfun = function (code) {
            var result = code.length > 10 ? code.substr(0, 10) : code;
            return result;
        };
        return filterfun;
    })
</script>
<script>
    //先进行 IP 登录
    /*if (sessionStorage.getItem("openMsg") == undefined) {
        //先显示  10 秒钟以后取消显示
        sessionStorage.setItem("openMsg", "true");
        var i = 10;
        var timer = setInterval(function () {
            if (i == -1) {
            } else {
                $("#down").html(i + ' ').css("color", "red");
                --i;
            }
        }, 1000);
        $("#loading").show();
        setTimeout(function () {
            $("#loading").hide();
        }, 12000); //10秒 正常用户大概在4到5秒能读完
    }*/
    var ms_ie = false;
    var ua = window.navigator.userAgent.toLowerCase();
    var old_ie = ua.indexOf('MSIE');
    var new_ie = ua.indexOf('trident/');
    var is360 = false;
    var append = document.getElementById("append");
    if ((old_ie > -1) || (new_ie > -1)) {
        ms_ie = true;
    }
    if (window.navigator.appName.indexOf("Microsoft") != -1) {
        me_ie = true;
    }
    if ((window.navigator.mimeTypes[40] || !window.navigator.mimeTypes.length)) {
        is360 = true;
    }
    if (ms_ie) {
        var DEFAULT_VERSION = 9.0;
        var ua = navigator.userAgent.toLowerCase();
        var isIE = ua.indexOf("msie") > -1;
        var safariVersion;
        if (isIE) {
            safariVersion = ua.match(/msie ([\d.]+)/)[1];
        }
        if (safariVersion <= DEFAULT_VERSION) {
            alert('系统检测到您正在使用ie10以下内核的浏览器，为了获得更好的体验建议使用Chrome、Firefox、IE11、Safari、360 IE10以上内核等浏览器')
        }
    }
    function closeMsg() {
        $("#loading").hide();
        $("#loadings").hide();
    }
    function loginCtrl($http, $scope) {

        function verifyScan(phone) {
            $.ajax({
                url: '/api/acl_user/verifyScan',
                type: 'post',
                data: { phone: phone },
                success: function (data) {
                    console.log(data, 2)
                    /*var ticket = data.success;*/
                    if (data.code == 200) {
                        $(location).attr('href', '/');
                        layer.alert("登录成功", { icon: 1, });
                        clearInterval(index);
                    }
                }
            });
        }
        var index
        var layer
        layui.use(['layer', 'form'], function () {
            layer = layui.layer;
            $('.WXCode').click(function () {
                if ($('.codePhone').val().trim() == "") {
                    layer.msg('请填写手机号', {
                        icon: 2,
                    });
                    return false;
                } else if ($('.wxCodeVal').val().trim() == '') {
                    layer.msg('请填写验证码', {
                        icon: 2,
                    });
                    return false;
                } else {
                    $.get("/api/acl_user/verifyScanWxCode?phone=" +
                        $('.codePhone').val().trim() + "&code=" + $('.wxCodeVal').val().trim(), function (res) {
                            if (res.code == 200) {
                                $(location).attr('href', '/');
                            } else {
                                layer.msg(res.msg, {
                                    icon: 2,
                                });
                                return false;
                            }
                        })
                }
            })
            $('.send').click(function () {
                if ($('.codePhone').val() == "") {
                    layer.msg('请填写手机号', {
                        icon: 2,
                    });
                    return false;
                } else {
                    $.get("/api/acl_user/phoneGetCode?phone=" +
                        $('.codePhone').val(), function (res) {
                            if (res.code == 200) {
                                $('#sendWXMo').show()
                                var num = 59
                                document.getElementById("sendWXMo").innerHTML = num + 'S'
                                var timer = setInterval(function () {
                                    num = num - 1
                                    document.getElementById("sendWXMo").innerHTML = num + 'S'
                                    if (num == 0) {
                                        $('#sendWXMo').hide()
                                        clearInterval(timer)
                                    }
                                }, 1000)
                            } else {
                                layer.msg(res.msg, {
                                    icon: 2,
                                });
                                return false;
                            }
                        })
                }
            })

            $('.getQRcode').click(function () {
                if ($('.QRcode').val() == "") {
                    layer.msg('请填写手机号', {
                        icon: 2,
                    });
                    return false;
                } else {
                    $.get("/api/acl_user/phoneCodesIsNull?phone=" +
                        $('.QRcode').val(), function (res) {
                            if (res.code == 200) {
                                index = setInterval(function () {
                                    verifyScan($(".QRcode").val())
                                }, 1000);
                                var host = window.location.host;
                                if (host == "127.0.0.1:8080") {
                                    host = "127.0.0.1:8080"
                                }
                                var urls = $('.QRcode').val() + '!' + window.location.protocol + '//' + host + '/api/acl_user/phoneCodesIsOpenids?phone=' + $('.QRcode').val()
                                $.ajax({
                                    url: 'https://polyoa.com/smsLogin/wechat/getTicket?phone=' + urls,
                                    type: 'get',
                                    success: function (data) {
                                        var ticket = data.result.ticket;
                                        var url = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' + ticket
                                        layer.open({
                                            type: 1,
                                            title: '扫码',
                                            maxmin: true,
                                            shadeClose: true, //点击遮罩关闭层
                                            area: ['300px', '300px'],
                                            content: '<div style="text-align:center">' +
                                                '<img src=" ' + url + ' " width="230px;" height="230px;" />' +
                                                '</div>'
                                        });
                                    }
                                });
                            } else {
                                layer.msg('请确认您的手机号已经绑定', {
                                    icon: 2,
                                });
                                return false;
                            }
                        })
                    return false;
                }
            })
        });
        document.getElementById("send").innerHTML = '获取验证码'
        $('#sendMo').hide()
        $('#sendWXMo').hide()
        $scope.send = function () {
            angularHttpGet($http, "http://127.0.0.1:8081/smsLogin/api/checkPhone?phone=" + $scope.phone, {}, function (data) {
                if (data.code === 200) {
                    $scope.resultText = ''
                    angularHttpPost($http, "/api/acl_user/phonesSend", { phone: $scope.phone }, function (data) {
                        if (data.code === 200) {
                            $scope.cookie = data.cookie
                            $scope.resultText = ''
                            document.getElementById("send").innerHTML = '发送成功'
                            $('#sendMo').show()
                            $scope.num = 59
                            document.getElementById("sendMo").innerHTML = $scope.num + 'S'
                            $scope.timer = setInterval(function () {
                                $scope.num = $scope.num - 1
                                document.getElementById("sendMo").innerHTML = $scope.num + 'S'
                                if ($scope.num == 0) {
                                    $('#sendMo').hide()
                                    document.getElementById("send").innerHTML = '获取验证码'
                                    clearInterval($scope.timer)
                                }
                            }, 1000)
                        }
                        else {
                            if (data.message.length < 10) {
                                $scope.resultText = data.message
                            } else {
                                $scope.resultText = '该手机号已达到当天使用最大次数'
                            }
                        }
                    })
                }
                else {
                    $scope.resultText = data.message
                }

            });
        }
        $scope.flagPassword = true
        $scope.flag = false
        $scope.flagOther = false
        $scope.flagWX = false
        $scope.flagWXCode = false
        $scope.toLogin = function (flag) {
            if (flag) {
                $scope.flagPassword = true
                $scope.flag = false
                $scope.flagOther = false
                $scope.onWX = false;
                $scope.onWXCode = false;
                $scope.flagWX = false
                $scope.flagWXCode = false
            } else {
                $scope.flagPassword = false
                $scope.flag = false
                $scope.flagOther = true
                $scope.onphone = false
                $scope.onWXCode = true
                $scope.onWX = false
                $scope.flagWX = false
                $scope.flagWXCode = true
            }
        }
        $scope.loginData = { verificationCode: "", account: "", accountPd: "" }
        $scope.registerData = { sex: "", password: "", account: "", name: "", userTypeFlag: "false", idCard: "", phone: "", email: "" }
        $scope.userData = { pasd: "", account: "", pasdold: "", code: "", email: "" }
        // 账号注册
        $scope.submitRegister = function () {
            var idCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
            var email = new RegExp("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$")
            //var email = /^\w+@[a-z0-9]+\.[a-z]{2,4}$/
            var phone = /^[1][3,4,5,7,8][0-9]{9}$/
            if ($scope.registerData.account.trim() == "") {
                $("#accountRegister").focus()
                alert("学工号不能为空!")
                return
            }
            if ($scope.registerData.password !== $scope.registerData.newpassword || $scope.registerData.password.trim() == "") {
                $("#newpasswordRegister").focus()
                alert("两次输入密码不一致,并且不能为空!")
                return
            }
            if ($scope.registerData.name.trim() == "") {
                $("#nameRegister").focus()
                alert("真实姓名不能为空!")
                return
            }
            /*if (idCard.test($scope.registerData.idCard.trim()) === false) {
                $("#idCardRegister").focus()
                alert("身份证号格式不正确!")
                return
            }*/
            if ($scope.registerData.phone.trim() === '') {

            } else {
                if (phone.test($scope.registerData.phone.trim()) === false) {
                    $("#phoneRegister").focus()
                    alert("手机号格式不正确!")
                    return
                }
            }

            if (!email.test($scope.registerData.email.trim())) {
                $("#emailRegister").focus()
                alert("邮箱格式不正确!")
                return
            }
            var verify = new RegExp('.{8,20}'); //获取正则表达式 存放到verify变量中
            var result = verify.test($scope.registerData.password.trim()); //判断输入框内容是否符合 正则表达式
            const listss = {
                account: $scope.registerData.account
            }
            if (result && $scope.registerData.password.trim() != "") {
                var data = new FormData($('#addForm')[0]);
                angularHttpPost($http, "/api/acl_user/newadd", $scope.registerData, function (data) {
                    if (data.code == 200) {
                        $("#register_content").modal("close")
                        $("#onadd").modal({ closeViaDimmer: true });
                        $("#onadd").modal("open");
                        setTimeout(function () {
                            $("#onadd").modal("close")
                        }, 2000)
                    } else {
                        alert(data.msg)
                    }
                });
            } else {
                alert('您的密码复杂度太低（密码长度为12-20位）')
            }

        }
        $scope.herf = GetQueryString("url")
        $scope.background_judgeFinances = false
        //$scope.background_loginIpSubmit = false
        $scope.background_password = true
        $scope.background_loginIpSubmit = false
        $scope.register = function () {
            //$scope.background_judgeFinances = false
            //$scope.background_loginIpSubmit = false
            //$scope.background_password = false
            //$scope.background_register = true
            //$scope.onldap = false;
            //$scope.onpassword = false;
            $("#register_content").modal({ closeViaDimmer: false })
            $("#register_content").modal("open");
            $scope.registerData = { sex: "", password: "", account: "", name: "", userTypeFlag: "false", idCard: "", phone: "", email: "" }
        }
        $scope.getemailcode = function () {
            if ($scope.userData.account.trim() == "") {
                $("#accountRegister").focus()
                alert("学工号不能为空!")
                return
            }
            var email = new RegExp("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$")
            if (!email.test($scope.userData.email.trim())) {
                $("#emailRegister").focus()
                alert("邮箱格式不正确!")
                return
            }
            var loginData = {
                account: $scope.userData.account,
                email: $scope.userData.email
            }
            angularHttpPost($http, "/api/acl_user/getthblpasdreadlall", loginData, function (data) {
                if (data.code == 200) {
                    $("#onemail").modal({ closeViaDimmer: false })
                    $("#onemail").modal("open")
                    setTimeout(function () {
                        $("#onemail").modal("close")
                    }, 800)
                    $('.emailcodem').show()
                    $scope.code = 60
                    document.getElementById("emailcodem").innerHTML = $scope.code + 'S'
                    $scope.emailtimer = setInterval(function () {
                        $scope.code = $scope.code - 1
                        console.log($scope.code)
                        document.getElementById("emailcodem").innerHTML = $scope.code + 'S'
                        if ($scope.code <= 0) {
                            clearInterval($scope.emailtimer)
                        }
                    }, 1000)
                } else {
                    alert(data.msg)
                }
            })
        }
        $scope.submitUser = function () {
            var idCard = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
            var email = new RegExp("^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-z]{2,}$")
            //var email = /^\w+@[a-z0-9]+\.[a-z]{2,4}$/
            var phone = /^[1][3,4,5,7,8][0-9]{9}$/
            if ($scope.userData.account.trim() == "") {
                //$("#accountRegister").focus()
                alert("学工号不能为空!")
                return
            }
            if ($scope.userData.code.trim() == "") {
                //$("#accountRegister").focus()
                alert("验证码不能为空!")
                return
            }
            var password = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{8,20}$/
            if (!password.test($scope.userData.pasdold)) {
                //$("#newpasswordRegister").focus()
                alert("密码格式不正确!")
                return
            }
            if ($scope.userData.pasd !== $scope.userData.pasdold || $scope.userData.pasd.trim() == "") {
                //$("#newpasswordRegister").focus()
                alert("两次输入密码不一致,并且不能为空!")
                return
            }

            if (!email.test($scope.userData.email.trim())) {
                //$("#emailRegister").focus()
                alert("邮箱格式不正确!")
                return
            }
            var loginData = {
                account: $scope.userData.account,
                email: $scope.userData.email,
                code: $scope.userData.code,
                pasd: $scope.userData.pasd,
                pasdold: $scope.userData.pasdold,
            }
            angularHttpPost($http, "/api/acl_user/setpwsdhtblusergetno", loginData, function (data) {
                if (data.code == 200) {
                    alert("修改成功 ， 请重新登录！");
                    $(location).attr('href', "/login");
                } else if (data.code == 400) {
                    alert(data.msg)

                }
            })

        }
        $scope.registeruser = function () {
            $("#user_content").modal({ closeViaDimmer: false })
            $("#user_content").modal("open");
            //$scope.userData = { pasd: "", account: "", pasdold: "",  code: "", email: "" }
        }
        angularHttpPost($http, "/api/acl_schoollogo/getList", {}, function (data) {
            angular.forEach(data.result, function (data) {
                if (data.type == 1) {
                    $scope.limg = data.name
                }
            });
        })
        $scope.newPhoneSubmit = function () {
            var obj = {
                phone: $scope.phone,
                code: $scope.phoneCode,
                cookie: $scope.cookie,
                csrfToken: $scope.csrfToken
            }
            angularHttpPost($http, "/api/acl_user/phoneslogin", obj, function (data) {
                if (data.code == 200) {
                    sessionStorage.removeItem('ipLoginData')
                    localStorage.setItem('loginData', JSON.stringify(data))
                    $scope.id = sessionStorage.getItem('detailId')
                    if ($scope.herf != '' && $scope.herf != null) {
                        //统计当前资源库的访问次数
                        var data1 = { 'id': $scope.id };
                        //判断是否管理员和是否处于授权期内
                        angularHttpPost($http, "/api/acl_webisite_config/updateLV", data1, function (data) {
                            //在授权期内
                            if (data.result.auth == true) {
                                $(location).attr('href', $scope.herf);
                            } else {
                                angularHttpPost($http, "/api/acl_user/identity", {}, function (data) {
                                    if (data.result.isAdmin == true) {
                                        //管理员身份跳到授权页面
                                        $(location).attr('href', "/website/auth");
                                    } else {
                                        $(location).attr('href', "/authError");
                                    }
                                })
                            }
                        });
                    } else {
                        $(location).attr('href', '/');
                    }
                } else {
                    $scope.resultText = data.message
                }
            })
        }
        $scope.newSubmit = function () {
            if ($scope.loginDatas.newPassword != $scope.loginDatas.oldPassword) {
                alert("两次输入密码不一致，请检查！");
            }
            var password = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{8,20}$/
            if (!password.test($scope.loginDatas.oldPassword)) {
                alert("密码格式不正确（密码中必须包含数字、大小写字母、特殊符号，且密码长度不小于8位）！");
                return
            }
            else {
                angularHttpPost($http, "/api/acl_user/changeFirst", {
                    "newPassword": Base64.encode($scope.loginDatas.newPassword), //校验通过的新密码 输入了两遍
                    "newPasswordTwo": Base64.encode($scope.loginDatas.oldPassword), //校验通过的新密码 输入了两遍
                    "account": Base64.encode($scope.loginData.account),  //用户名
                    "oldPassword": Base64.encode($scope.loginData.accountPd), //用户之前的老密码  加这个主要是进行双重验证
                    "code": $scope.loginData.verificationCode,
                    "csrfToken": $scope.csrfToken
                }, function (data) {
                    if (data.code === 200) {
                        alert("修改成功 ， 请重新登录！");
                        $(location).attr('href', "/login"); //修改成功以后 让用户重新登录一下 跳转到登录页面
                    }
                    else {
                        alert(data.msg);
                    }

                });

            }
        }
        angularHttpPost($http, "/api/acl_schoollogo/getList", {}, function (data) {
            angular.forEach(data.result, function (data) {
                if (data.type == 1) {
                    $scope.limg = data.name
                }
            });
        })
        $scope.loginSubmit = function () {
            if ($scope.loginData.account.trim() == "" || $scope.loginData.accountPd.trim() == "" || $scope.loginData.verificationCode.trim() == "") {
                alert("输入内容不能为空！")
                return
            }
            localStorage.setItem('GUESSWHATIAM', $scope.loginData.accountPd)
            angularHttpPost($http, "/api/acl_user/verifyUpd", { csrfToken: $scope.csrfToken, code: $scope.loginData.verificationCode, account: Base64.encode($scope.loginData.account), accountPd: Base64.encode($scope.loginData.accountPd) }, function (data) {
                if (data.code == 200 && data.userType == "1") {
                    setTimeout(function () {
                        $("#loadings").show();
                    }, 10); //4.5秒 正常用户大概在4到5秒能读完
                } else if (data.code == 400) {
                    alert("验证码输入不正确，请重新输入！")
                    $('#imagess').trigger('click')
                    $scope.loginData.verificationCode = ''
                } else {

                    var loginData = {}
                    loginData.account = $scope.loginData.account
                    loginData.accountPd = $scope.loginData.accountPd
                    loginData.accountPd = Base64.encode(loginData.accountPd)
                    loginData.account = Base64.encode(loginData.account)
                    loginData.csrfToken = $scope.csrfToken
                    //loginData.code = loginData.verificationCode
                    if (sessionStorage.getItem('SCHOOLNAME') == 'dbly' && $scope.background_judgeFinances == true) {
                        angularHttpPost($http, "/api/acl_user/financeLoginsdbly", loginData, function (data) {
                            if (data.code == 200) {
                                $(location).attr('href', '/')
                            } else {
                                alert("提示信息：学工号或密码错误！")
                            }
                        })
                    } else {
                        //if ($scope.loginData.verificationCode.trim() == "") {
                        //alert("验证码不能为空!")
                        //return
                        //}
                        loginData.code = $scope.loginData.verificationCode
                        angularHttpPost($http, "/api/acl_user/login", loginData, function (data) {
                            if (data.code == 200) {
                                sessionStorage.removeItem('ipLoginData')
                                localStorage.setItem('loginData', JSON.stringify(data))
                                //获取授权信息并将授权状态放入req.session
                                //angularHttpPost($http,"/api/acl_website_auth/getAuth",{},function(data){
                                //if(data.code == 200){
                                // $scope.herf=sessionStorage.getItem('detailhref');
                                $scope.id = sessionStorage.getItem('detailId');
                                //sessionStorage.setItem('detailhref','');
                                if (false&&$scope.herf != '' && $scope.herf != null) {
                                    //统计当前资源库的访问次数
                                    var data1 = { 'id': $scope.id };
                                    //判断是否管理员和是否处于授权期内
                                    angularHttpPost($http, "/api/acl_webisite_config/updateLV", data1, function (data) {
                                        localStorage.removeItem("openurl");
                                        //在授权期内
                                        if (data.result.auth == true) {
                                            $(location).attr('href', $scope.herf);
                                        } else {
                                            angularHttpPost($http, "/api/acl_user/identity", {}, function (data) {
                                                if (data.result.isAdmin == true) {
                                                    //管理员身份跳到授权页面
                                                    $(location).attr('href', "/website/auth");
                                                } else {
                                                    $(location).attr('href', "/authError");
                                                }
                                            })
                                        }
                                    });
                                }
                                else {
                                    sessionStorage.setItem('isOne', '')
                                    $(location).attr('href', '/');
                                }

                            } else {
                                if (data.code == 400) {
                                    $('#imagess').trigger('click')
                                    alert(data.msg)
                                    $scope.loginData.verificationCode = ''
                                } else {
                                    $('#imagess').trigger('click')
                                    $scope.loginData.verificationCode = ''
                                    $("#verificationCode").focus()
                                    setTimeout(function () {
                                        alert("提示信息：学工号或密码错误！")
                                    }, 100)
                                }
                            }
                        });
                    }

                }
            })
        },
            $scope.getToken = function () {

                setTimeout(function () {
                    angularHttpPost($http, "/api/acl_user/lossoTokens", {}, function (data) {
                        $('#token').val(data.value)
                        $scope.csrfToken = data.value
                    })
                }, 1200)
            }
        $scope.getToken()
        //2020年10月13日15:27:23   mkl 新加根据ip登录方法
        $scope.loginIpSubmit = function () {
            $scope.background_loginIpSubmit = true
            $scope.background_judgeFinances = false
            $scope.background_password = false
            $scope.background_register = false
            setTimeout(function () {
                angularHttpPost($http, "/api/acl_user/ipLogins", { "type": "" }, function (data) {
                    if (data.code == 200) {
                        $scope.id = sessionStorage.getItem('detailId');
                        localStorage.removeItem('LoginData')
                        sessionStorage.setItem('ipLoginData', JSON.stringify(data))
                        if ($scope.herf != '' && $scope.herf != null) {
                            //统计当前资源库的访问次数
                            var data1 = { 'id': $scope.id };
                            //判断是否管理员和是否处于授权期内
                            angularHttpPost($http, "/api/acl_webisite_config/updateLV", data1, function (data) {
                                //在授权期内
                                if (data.result.auth == true) {
                                    $(location).attr('href', $scope.herf);
                                } else {
                                    angularHttpPost($http, "/api/acl_user/identity", {}, function (data) {
                                        if (data.result.isAdmin == true) {
                                            //管理员身份跳到授权页面
                                            $(location).attr('href', "/website/auth");
                                        } else {
                                            $(location).attr('href', "/authError");
                                        }
                                    })
                                }
                            });
                        }
                        else {
                            $(location).attr('href', '/');
                        }
                    } else {
                        setTimeout(function () {
                            alert("提示信息：" + data.msg);
                        }, 1);
                    }
                });

            }, 20);
        },
            //2020年10月13日15:27:23   mkl 新加根据ip登录方法
            $scope.loginIpSubmits = function () {
                //$scope.background_loginIpSubmit = true
                // $scope.background_judgeFinances = false
                // $scope.background_password = false 
                setTimeout(function () {
                    angularHttpPost($http, "/api/acl_user/ipLogins", { "type": "" }, function (data) {
                        if (data.code == 200) {
                            $scope.id = sessionStorage.getItem('detailId');
                            localStorage.removeItem('LoginData')
                            sessionStorage.setItem('ipLoginData', JSON.stringify(data))
                            if ($scope.herf != '' && $scope.herf != null) {
                                //统计当前资源库的访问次数
                                var data1 = { 'id': $scope.id };
                                //判断是否管理员和是否处于授权期内
                                angularHttpPost($http, "/api/acl_webisite_config/updateLV", data1, function (data) {
                                    //在授权期内
                                    if (data.result.auth == true) {
                                        $(location).attr('href', $scope.herf);
                                    } else {
                                        angularHttpPost($http, "/api/acl_user/identity", {}, function (data) {
                                            if (data.result.isAdmin == true) {
                                                //管理员身份跳到授权页面
                                                $(location).attr('href', "/website/auth");
                                            } else {
                                                $(location).attr('href', "/authError");
                                            }
                                        })
                                    }
                                });
                            }
                            else {
                                $(location).attr('href', '/');
                            }
                        } else {

                            if (sessionStorage.getItem("openMsgs") == undefined) {
                                sessionStorage.setItem("openMsgs", "true");
                                setTimeout(function () {
                                    // alert("提示信息：" + data.msg);
                                }, 1);

                            }
                        }
                    });

                }, 20);
            },
            //2020年10月23日10:50:32   mkl 新加判断
            //判断是否开启第三方认证对接 如果开启就进行跳转, 没开启就弹框提示用户没开启第三方登录
            $scope.judgeFinances = function () {
                $scope.background_loginIpSubmit = false
                $scope.background_judgeFinances = true
                $scope.background_password = false
                $scope.background_register = false
                sessionStorage.removeItem('ipLoginData')
                sessionStorage.removeItem('loginData')
                if (sessionStorage.getItem('SCHOOLNAME') == 'dbly') {
                    $('.flagPassword .mycanvas_box').hide()
                    $scope.loginData = { verificationCode: "", account: "", accountPd: "" }
                    return
                }
                setTimeout(function () {
                    //调用校验认证对接状态接口
                    angularHttpPost($http, "/api/acl_user/authenticVerification", {}, function (data) {
                        if (data.code == 200) {
                            if (data.name == "zzdx") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hbmz") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "dbsf") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "cslg") {
                                // 长沙理工大学统一身份认证
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "ssd") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "bendics") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "nzxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zncj") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "nxdx") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "ykdx") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hjj") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hljzyy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "sjxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "shsf") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "hgd") {
                                //哈工大
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "nmgny") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "mtxy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "scwy") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zdhs") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else if (data.name == "zdhsnwwg") {
                                var id = "schoolname"; var a = document.createElement("a"); a.setAttribute("href", data.url); a.setAttribute("target", "_parent"); a.setAttribute("id", id); if (!document.getElementById(id)) { document.body.appendChild(a); } a.click();
                            } else {
                                alert("请确认是否已配置学校");
                            }


                            // 
                        }
                        //    else {
                        //认证失败 弹框提示用户
                        //      alert("请确任是否开启服务认证对接！");
                        //   }
                    });

                }, 20);

            }

        //获取授权信息并将授权状态放入req.session
        //angularHttpPost($http,"/api/acl_website_auth/getAuth",{},function(data){});
        //默认账号密码登录
        $scope.onldap = true;
        $scope.onpassword = false;
        $scope.nameText = '学/工号/邮箱'
        //点击账号密码登录
        $scope.password = function () {
            if ($scope.onldap || sessionStorage.getItem('SCHOOLNAME') == 'dbly') {
                $('#imagess').trigger('click')
                $scope.loginData = { verificationCode: "", account: "", accountPd: "" }
            }
            $('.flagPassword .mycanvas_box').show()
            $scope.onldap = false;
            $scope.onpassword = true;
            $scope.nameText = '学工号'
            $scope.background_judgeFinances = false
            $scope.background_loginIpSubmit = false
            $scope.background_password = true
            $scope.background_register = false
        }
        $scope.tophone = function () {
            $scope.onphone = true;
            $scope.onWX = false;
            $scope.flag = true
            $scope.flagWX = false
            $scope.flagWXCode = false
            $scope.onWXCode = false;
        }
        $scope.toWeiXin = function () {
            $scope.onphone = false;
            $scope.onWX = true;
            $scope.flag = false
            $scope.onWXCode = false;
            $scope.flagWX = true
            $scope.flagWXCode = false
        }
        $scope.toWeiXinCode = function () {
            $scope.onphone = false
            $scope.onWX = false
            $scope.flag = false
            $scope.flagWX = false
            $scope.flagWXCode = true
            $scope.onWXCode = true
        }
        //点击ldap认证登录
        $scope.ldap = function () {
            $scope.nameText = '学/工号/邮箱'
            if ($scope.onpassword) {
                $('#imagess').trigger('click')
                $scope.loginData = { verificationCode: "", account: "", accountPd: "" }
            }
            $scope.onldap = true;
            $scope.onpassword = false;
            $scope.background_register = false
        }


    }


    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }



</script>

<script>






    function resetCookie() {


        var domainReg = RegExp("/extdomains/" + "(https://|http://)?.*?/", "gi");//获取url中的域名路径
        //  console.log(domainReg.source)

        var windowHref = window.location.href; //返回整个url字符串(在浏览器中就是完整的地址栏)
        var domainResult = domainReg.exec(windowHref);
        var cookiePath = window.location.pathname.substring(0, window.location.pathname.indexOf("/extdomains/") + 1)
        var strCookie = document.cookie;
        var arrCookie = strCookie.split("; ");

        var pathReg = /path=([^;]*)/gi;
        for (var i = 0; i < arrCookie.length; i++) {
            var arr = arrCookie[i].split("=");

            if (arr[0] != undefined && arr[0].length > 0 && arr[0] != 'undefined' && arr[1] != undefined && arr[1] != 'undefined' && arr[0] != 'acl-poly' && arr[0] != 'ccsess') {
                delCookie(arr[0])

                document.cookie = arr[0] + "=; " + "expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";
                document.cookie = arr[0] + "=; " + "expires=Thu, 01-Jan-70 00:00:01 GMT; path=/" + "; domain=." + document.domain;
                document.cookie = arr[0] + "=; " + "expires=Thu, 01-Jan-70 00:00:01 GMT; path=/" + "; domain=" + document.domain.substring(document.domain.indexOf("."), document.domain.length);
            }



        }

    }




    //写cookies
    function setCookie(c_name, value, expiredays) {
        var exdate = new Date();
        exdate.setDate(exdate.getDate() + expiredays);
        document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
    }
    //读取cookies
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg))
            return (arr[2]);
        else
            return null;
    }

    //删除cookies
    function delCookie(name) {
        var exp = new Date();
        exp.setTime(exp.getTime() - 10);
        var cval = getCookie(name);
        if (cval != null) {
            document.cookie = name + "=; " + "expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";

        }
    }



    var timecount = 0;

    resetCookie();

    window.onload = function () {
        //getCode(options)
        //getcodeimgss();
        $.ajax({
            url: '/api/acl_user/codeimg?' + Math.random(),
            type: 'get',
            success: function (data) {
                setTimeout(function () {
                    $("#imagess").attr('src', '/api/acl_user/codeimg?' + Math.random());
                }, 500)
            }

        });

    }

    function getcodeimgs() {
        setTimeout(function () {
            $("#imagess").attr('src', '/api/acl_user/codeimg?' + Math.random());
            $("#imagess").attr('src', '/api/acl_user/codeimg?' + Math.random());
        }, 100);
    }
    /**
    function getcodeimgss() {
        setTimeout(function () {
            $("#imagess").attr('src', '/api/acl_user/codeimg?' + Math.random());
        },1600);
    }*/
</script>

