1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Aisky-Sixth</title>
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <!-- 新 Bootstrap4 核心 CSS 文件 -->
- <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
- <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
- <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
- <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
- <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
- <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
- <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
- <script src="../static/js/sign_in.js"></script>
- <link rel="stylesheet" href="../static/css/sign_in.css">
- {% if errMsg %}
- <script>
- $(function(){
- $(".wrong-span").text("{{errMsg}}");
- });
- </script>
- {% endif %}
- <script>
- function SignIn(){
- var username = $("input[name=username]").val();
- var password = $("input[name=password]").val();
- var data = {"username":username, "password":password};
- $.ajax({
- url: "/login",
- type: "post",
- data: data,
- dataType: "json",
- success: function(res){
- if(res.access_token){
- console.log("test");
- localStorage.setItem('Hello', res.access_token);
- window.location.href='/';
- };
- if(res.errMsg){
- $(".wrong-span").text("{{errMsg}}");
- };
- },
- });
- };
- </script>
- </head>
- <body>
- <div class="container">
- <div class="row">
- <div class="col-2"></div>
- <div class="col">
- <img src="../static/img/logo_new.png" class="img-fluid">
- <h1 class="text-center">Sign in</h1>
- <!--<form method="post" action="/login">-->
- <div class="wrong-info"><span class="wrong-span"></span></div>
- <div class="form">
- <div class="form-inline">
- <label for="usr">Login</label>
- <input type="text" class="form-control" id="usr" name="username">
- </div>
- <div class="form-inline">
- <label for="pwd">Password</label>
- <input type="password" class="form-control" id="pwd" name="password">
- </div>
- <div class="radio">
- <label><input type="checkbox" name="rem"> Remember me</label>
- <a href="#">Reset password</a>
- </div>
- </div>
- <div class="text-center">
- <input type="submit" class="btn btn-info" value="Log in" onclick="SignIn()" style="margin-right:100px;">
- <input type="button" class="btn btn-info" value="Registration" onclick="Registration()">
- </div>
- <!--</form>-->
- </div>
- <div class="col-2"></div>
- </div>
- </div>
- </body>
- </html>
|