123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- <?php
- namespace app\index;
- class login extends Base
- {
- function index()
- {
- if ($this->userlogined) {
- redirect("/index/user_profile");
- }
- ?> <!DOCTYPE html>
- <html lang="">
- <head>
- <title>账号登录 - <?php echo IN_NAME;?>免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
- <meta charset="utf-8"/>
- <meta name="viewport"
- content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
- <meta name="renderer" content="webkit"/>
- <meta name="keywords" content="<?php echo IN_KEYWORDS;?>"/>
- <meta property="og:url" content="https://<?php echo $_SERVER["HTTP_HOST"];?>/"/>
- <meta property="og:title" content="<?php echo IN_NAME;?>"/>
- <meta name="description" content="<?php echo IN_DESCRIPTION;?>"/>
- <?php
- $this->static_();
- ?> </head>
- <body>
- <?php
- $this->header();
- ?>
- <style>
- .em {
- font-style: normal;
- }
- .login-three-home {
- height: 84px;
- padding: 30px 0 0 0;
- width: 355px;
- text-align: center;
- }
- .clearfix:before {
- content: ".";
- display: block;
- height: 0;
- overflow: hidden;
- visibility: hidden;
- }
- .login-three-home h3 {
- font-size: 12px;
- color: #666;
- text-align: center;
- padding: 5px 0 20px 0;
- width: 409px;
- height: 14px;
- background: url(/qq/image/line.jpg) left center repeat-x;
- }
- .login-three-home h3 em {
- background: #fff;
- padding: 0 5px;
- }
- a#qq {
- background-position: 0 -335px;
- }
- .login-three a, .login-three-home a {
- display: inline-block;
- width: 40px;
- height: 40px;
- margin-right: -50px;
- background: url(/qq/image/focus2018.png) no-repeat;
- }
- </style>
- <script src="/static/index/js/jquery.validate.min.js"></script>
- <div class="login-common">
- <div class="tit">
- <div id="acc_login" class="tit" style="display:inline-block;cursor:pointer">账号登录</div>
-
- <?php if (IN_SMS666666) { ?>
-
- <div id="phone_login" class="tit" style="display:inline-block;color:rgba(118, 144, 181, 1);cursor:pointer">短信登录</div>
- <?php } ?>
-
- </div>
-
- <form role="form" id="loginValid" novalidate="novalidate">
- <input type="password" style="position: absolute;top: -999px"/>
- <div class="form-group">
- <label class="iconfont icon-user" for="user"></label>
- <input type="text" class="form-control input-lg" id="user" name="username"
- aria-describedby="helpBlock2"
- placeholder="账号名称">
- <span class="help-block">请输入正确的账号名称</span>
- </div>
- <div class="form-group">
- <label class="iconfont icon-pwd" for="password"></label>
- <input class="form-control input-lg" id="password" name="password" placeholder="登录密码"
- type="password">
- <span class="help-block">请输入正确的密码</span>
- </div>
- <div class="btn-action">
- <a href="/index/lost" class="fr">忘记密码?</a>
- <?php if (IN_SMS666666) { ?>
- <a id="phone_login_btn">手机验证码登录</a>
- <?php } ?>
- </div>
- <!-- <div class="checkbox"><input type="checkbox" id="remember-me" checked><span>记住我</span></div> -->
- <button type="button" class="ms-btn ms-btn-primary input-lg btn-login" id="submitButton">登录</button>
- <div class="clearfix mt15 to-register">
- <?php if (IN_REG_ON) { ?>还没有账号? <a href="/index/reg" class="fl">去注册</a>
- <?php } ?>
- <!-- <a href="/index/lost" class="fr">忘记密码</a> -->
- </div>
- </form>
-
- <form role="form" id="loginValid_code" novalidate="novalidate" style="display:none">
- <font color="#FF0000" style="font-size:20px">未设置短信,请使用左边的账号登录。<br>需要测试短信登录功能请联系客服设置。</font>
- <div class="form-group">
- <label class="iconfont icon-user" for="phone"></label>
- <input type="text" class="form-control input-lg" id="phone" name="phone"
- aria-describedby="helpBlock2"
- placeholder="手机号码">
- <span class="help-block">请输入正确的手机</span>
- </div>
-
-
- <div class="form-group">
- <label class="iconfont icon-email"></label>
- <div class="clearfix verification-code">
- <input type="text" class="form-control input-lg fl" id="code" placeholder="验证码">
- <button type="button" class="ms-btn ms-btn-primary input-lg fr" id="sendcode">获取验证码</button>
- </div>
- <span class="help-block">请输入正确的验证码</span>
- </div>
-
- <button type="button" class="ms-btn ms-btn-primary input-lg btn-login" id="submitButton_code">登录</button>
- <div class="clearfix mt15 to-register">
- <?php if (IN_REG_ON) { ?>还没有账号? <a href="/index/reg" class="fl">去注册</a>
- <?php } ?>
- </div>
- </form>
- <!--新增QQ互联登录-->
- <?php if (IN_QQ) { ?>
- <div class="login-three-home clearfix"><h3>社交登录</h3> <a onClick="test();" class="login_click" id="qq"></a></div>
- <?php } ?>
- <!--新增QQ互联登录-->
- </div>
- <script>
- $(function () {
-
- countdown = 60;
-
- function settime() {
- if (countdown == 0) {
- $('#sendcode').attr("disabled", false);
- $('#sendcode').html("获取验证码");
- countdown = 60;
- return;
- } else {
- $('#sendcode').attr("disabled", true);
- $('#sendcode').html("重新发送(" + countdown + ")");
- countdown--;
- }
- setTimeout(function () {
- settime()
- }, 1000)
- }
-
-
-
- $('#sendcode').click(function () {
- var phone = $('#phone').val();
- if (phone) {
- $.post('/index/ajax/send_sms_forget', {phone: phone}, function (data) {
- if (data.code != 200) {
- alert(data.msg);
- } else {
- settime();
- alert(data.msg);
- }
- }, 'json');
- }
- });
-
-
-
-
-
- $('#acc_login').click(function(){
- $('#phone_login').css('color','rgba(118, 144, 181, 1)');
- $('#acc_login').css('color','rgba(21, 21, 21, 1)');
- $('#loginValid').css('display','block');
- $('#loginValid_code').css('display','none');
- })
-
- $('#phone_login').click(function(){
- $('#phone_login').css('color','rgba(21, 21, 21, 1)');
- $('#acc_login').css('color','rgba(118, 144, 181, 1)');
- $('#loginValid').css('display','none');
- $('#loginValid_code').css('display','block');
-
- })
-
- $('#phone_login_btn').click(function(){
- $('#phone_login').css('color','rgba(21, 21, 21, 1)');
- $('#acc_login').css('color','rgba(118, 144, 181, 1)');
- $('#loginValid').css('display','none');
- $('#loginValid_code').css('display','block');
- })
-
- $("#submitButton_code").click(function () {
- var phone = $("#phone").val();
- var code = $("#code").val();
- $.post("/index/ajax/phone_code_login", {phone: phone, code: code},
- function (data) {
- if (data.code != 200) {
- alert(data.msg);
- } else {
- // if ($('#remember-me').is(':checked')) {
- // localStorage.setItem('user', user);
- // localStorage.setItem('password', password);
- // localStorage.setItem('bit', 'true');
- // } else {
- localStorage.removeItem('user');
- localStorage.removeItem('password');
- localStorage.removeItem('bit');
- // }
- window.location.href = '/index/apps/apps';
- }
- }, 'json');
- });
-
-
-
-
-
-
-
- if (localStorage.getItem('bit') === 'true') {
- $('#remember-me').attr('checked', 'checked');
- $('#user').val(localStorage.getItem('user'));
- $('#password').val(localStorage.getItem('password'));
- }
- $("#submitButton").click(function () {
- var user = $("#user").val();
- var password = $("#password").val();
- $.post("/index/ajax/login", {user: user, password: password},
- function (data) {
- if (data.code != 200) {
- alert(data.msg);
- } else {
- if ($('#remember-me').is(':checked')) {
- localStorage.setItem('user', user);
- localStorage.setItem('password', password);
- localStorage.setItem('bit', 'true');
- } else {
- localStorage.removeItem('user');
- localStorage.removeItem('password');
- localStorage.removeItem('bit');
- }
- window.location.href = '/index/apps/apps';
- }
- }, 'json');
- });
- document.onkeydown = function (event) {
- var e = event || window.event;
- if (e && e.keyCode == 13) {
- $("#submitButton").click();
- }
- };
- $("#loginValid").validate({
- errorPlacement: function (error, element) {
- error.appendTo(element.parent().parent());
- },
- rules: {
- "mobile": {
- required: true,
- mobile: true
- },
- "password": {
- required: true,
- minlength: 5
- }
- },
- messages: {
- mobile: {
- required: "手机号不能为空",
- mobile: "请输入正确的手机号"
- },
- password: {
- required: "密码不能为空",
- minlength: "密码长度最少5位"
- }
- },
- highlight: function (element) {
- $(element).closest('.form-group').addClass('has-error');
- },
- unhighlight: function (element) {
- $(element).closest('.form-group').removeClass('has-error');
- },
- errorElement: 'label',
- errorPlacement: function (error, element) {
- if (element.parent('.input-group').length) {
- error.insertAfter(element.parent());
- } else {
- error.insertAfter(element);
- }
- }
- });
- });
- </script>
- <script type="text/javascript">
- function test() {
- window.open('/index/qlogin/login');
- }
- </script>
- <script>
- $(document).ready(function () {
- var r = window.setInterval(function () {
- $.ajax({
- type: 'POST',
- url: '/index/qlogin/check',
- dataType: 'text',
- success: function (str) {
- if (str == "ok") {
- window.location.reload();
- }
- }
- });
- }, 500);
- });
- </script>
- <?php
- $this->footer();
- ?> </body>
- </html>
- <?php
- }
- }
|