|
@@ -5,375 +5,399 @@ namespace app\index;
|
|
|
|
|
|
class login extends Base
|
|
|
{
|
|
|
- function index()
|
|
|
- {
|
|
|
- if ($this->userlogined) {
|
|
|
- redirect("/index/user_profile");
|
|
|
- }
|
|
|
- ?> <!DOCTYPE html>
|
|
|
+ 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"/>
|
|
|
+ <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>
|
|
|
+ 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_();
|
|
|
+ ?>
|
|
|
+ <link rel="stylesheet" href="/static/index/css/login.css">
|
|
|
+ </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
|
|
|
+ $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) { ?>
|
|
|
- <a id="phone_login_btn">手机验证码登录</a>
|
|
|
+
|
|
|
+ <div id="phone_login" class="tit" style="display:inline-block;color:rgba(118, 144, 181, 1);cursor:pointer">短信登录</div>
|
|
|
<?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 } ?>
|
|
|
+
|
|
|
+ <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">
|
|
|
+ </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>
|
|
|
+ <label class="iconfont icon-email"></label>
|
|
|
|
|
|
- <div class="clearfix verification-code">
|
|
|
+ <div class="clearfix verification-code">
|
|
|
|
|
|
- <input type="text" class="form-control input-lg fl" id="code" placeholder="验证码">
|
|
|
+ <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>
|
|
|
+ <button type="button" class="ms-btn ms-btn-primary input-lg fr" id="sendcode">获取验证码</button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <span class="help-block">请输入正确的验证码</span>
|
|
|
|
|
|
</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;
|
|
|
|
|
|
-
|
|
|
- <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) {
|
|
|
+ if (countdown == 0) {
|
|
|
+
|
|
|
+ $('#sendcode').attr("disabled", false);
|
|
|
|
|
|
- $('#sendcode').attr("disabled", false);
|
|
|
+ $('#sendcode').html("获取验证码");
|
|
|
|
|
|
- $('#sendcode').html("获取验证码");
|
|
|
+ countdown = 60;
|
|
|
|
|
|
- countdown = 60;
|
|
|
+ return;
|
|
|
|
|
|
- return;
|
|
|
+ } else {
|
|
|
+
|
|
|
+ $('#sendcode').attr("disabled", true);
|
|
|
|
|
|
- } else {
|
|
|
+ $('#sendcode').html("重新发送(" + countdown + ")");
|
|
|
|
|
|
- $('#sendcode').attr("disabled", true);
|
|
|
+ countdown--;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- $('#sendcode').html("重新发送(" + countdown + ")");
|
|
|
+ setTimeout(function() {
|
|
|
|
|
|
- countdown--;
|
|
|
+ settime()
|
|
|
+
|
|
|
+ }, 1000)
|
|
|
|
|
|
}
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
|
|
|
- settime()
|
|
|
|
|
|
- }, 1000)
|
|
|
+ $('#sendcode').click(function() {
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $('#sendcode').click(function () {
|
|
|
+ var phone = $('#phone').val();
|
|
|
|
|
|
- var phone = $('#phone').val();
|
|
|
+ if (phone) {
|
|
|
|
|
|
- if (phone) {
|
|
|
+ $.post('/index/ajax/send_sms_forget', {
|
|
|
+ phone: phone
|
|
|
+ }, function(data) {
|
|
|
|
|
|
- $.post('/index/ajax/send_sms_forget', {phone: phone}, function (data) {
|
|
|
+ if (data.code != 200) {
|
|
|
|
|
|
- if (data.code != 200) {
|
|
|
+ alert(data.msg);
|
|
|
|
|
|
- alert(data.msg);
|
|
|
+ } else {
|
|
|
|
|
|
- } else {
|
|
|
+ settime();
|
|
|
+ alert(data.msg);
|
|
|
+ }
|
|
|
|
|
|
- settime();
|
|
|
- alert(data.msg);
|
|
|
- }
|
|
|
+ }, 'json');
|
|
|
|
|
|
- }, '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');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $('#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';
|
|
|
}
|
|
|
- window.location.href = '/index/apps/apps';
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
- });
|
|
|
+ }, 'json');
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
- document.onkeydown = function (event) {
|
|
|
- var e = event || window.event;
|
|
|
- if (e && e.keyCode == 13) {
|
|
|
- $("#submitButton").click();
|
|
|
+
|
|
|
+ if (localStorage.getItem('bit') === 'true') {
|
|
|
+ $('#remember-me').attr('checked', 'checked');
|
|
|
+ $('#user').val(localStorage.getItem('user'));
|
|
|
+ $('#password').val(localStorage.getItem('password'));
|
|
|
}
|
|
|
- };
|
|
|
-
|
|
|
- $("#loginValid").validate({
|
|
|
- errorPlacement: function (error, element) {
|
|
|
- error.appendTo(element.parent().parent());
|
|
|
- },
|
|
|
- rules: {
|
|
|
- "mobile": {
|
|
|
- required: true,
|
|
|
- mobile: true
|
|
|
- },
|
|
|
- "password": {
|
|
|
- required: true,
|
|
|
- minlength: 5
|
|
|
+
|
|
|
+ $("#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();
|
|
|
}
|
|
|
- },
|
|
|
- messages: {
|
|
|
- mobile: {
|
|
|
- required: "手机号不能为空",
|
|
|
- mobile: "请输入正确的手机号"
|
|
|
+ };
|
|
|
+
|
|
|
+ $("#loginValid").validate({
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
},
|
|
|
- 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);
|
|
|
+ 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();
|
|
|
- }
|
|
|
- }
|
|
|
+ </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);
|
|
|
});
|
|
|
- }, 500);
|
|
|
- });
|
|
|
- </script>
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <?php
|
|
|
+ $this->footer();
|
|
|
+ ?>
|
|
|
+ </body>
|
|
|
|
|
|
- <?php
|
|
|
- $this->footer();
|
|
|
- ?> </body>
|
|
|
</html>
|
|
|
|
|
|
- <?php
|
|
|
- }
|
|
|
-}
|
|
|
+<?php
|
|
|
+ }
|
|
|
+}
|