12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <link rel="stylesheet" href="/resources/bootstrap-3.4.1-dist/css/bootstrap.min.css" />
- <title>RedisDog - 登录</title>
- <style type="text/css">
- body{
- padding: 0px 10px;
- font-size: 14px;
- }
- h1{
- margin: 30px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div class="container" style="width:400px;">
- <h1>RedisDog</h1>
- <form action="/login" method="POST" id="loginform">
- <div class="form-group">
- <label for=""><strong>用户名</strong></label>
- <input type="text" class="form-control" name="account" maxlength="20" value="" />
- </div>
- <div class="form-group">
- <label for=""><strong>密码</strong></label>
- <input type="password" class="form-control" name="passwd" maxlength="20" value="" />
- </div>
- <button type="submit" class="btn btn-primary">提交</button>
- <button type="button" class="btn btn-default">忘记密码</button>
- </form>
- </div>
- <script type="text/javascript" src="/resources/js/jquery-3.4.1.min.js"></script>
- <script type="text/javascript" src="/resources/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
- <script type="text/javascript" src="/resources/js/common.js"></script>
- <script type="text/javascript">
- $(function(){
- $('#loginform').submit(function(){
- if (this.account.value == '') {
- $.alert('请填写要登录的账号!');
- } else if (/\W/.test(this.account.value)) {
- $.alert('账号格式不正确!');
- } else if (this.passwd.value == '') {
- $.alert('请填写账号密码!');
- } else {
- $.post(this.action, $(this).serialize(), function(resp){
- if (resp.errno) {
- $.alert(resp.error);
- } else {
- document.location = 'index';
- }
- }, 'json');
- }
- return false;
- });
- });
- </script>
- </body>
- </html>
|