| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>注册界面</title>
- <script src="../js/jquery-2.1.4.js"></script>
- <style>
- /* 全局样式重置 */
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- font-family: "Microsoft Yahei", sans-serif;
- }
- /* 页面背景 */
- body {
- background-color: #f5f5f5;
- display: flex;
- flex-direction: column;
- align-items: center;
- padding-top: 100px;
- }
- /* 标题样式 */
- h1 {
- color: #333;
- margin-bottom: 30px;
- font-size: 28px;
- font-weight: 600;
- }
- /* 表单容器 */
- form {
- background-color: #fff;
- padding: 40px 30px;
- border-radius: 8px;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
- width: 400px;
- }
- /* 输入框样式 */
- input[type="text"],
- input[type="password"] {
- width: 100%;
- padding: 12px 15px;
- margin: 10px 0 20px 0;
- border: 1px solid #ddd;
- border-radius: 4px;
- font-size: 16px;
- transition: border-color 0.3s;
- }
- /* 输入框聚焦样式 */
- input[type="text"]:focus,
- input[type="password"]:focus {
- outline: none;
- border-color: #409eff;
- box-shadow: 0 0 5px rgba(64, 158, 255, 0.2);
- }
- /* 保存按钮样式 */
- input[type="button"] {
- width: 100%;
- padding: 12px;
- border: none;
- border-radius: 4px;
- font-size: 16px;
- cursor: pointer;
- transition: background-color 0.3s;
- background-color: #409eff;
- color: #fff;
- }
- input[type="button"]:hover {
- background-color: #337ecc;
- }
- /* 标签样式 */
- form label {
- color: #666;
- font-size: 16px;
- display: inline-block;
- width: 60px;
- }
- </style>
- </head>
- <body>
- <h1>注册界面</h1>
- <form action="">
- 账号: <input type="text" name="username" id="username"> <br>
- 密码: <input type="password" name="password" id="password"> <br>
- <input type="button" value="保存" onclick="register()">
- </form>
- <script>
- function register() {
- console.log("123")
- var username = document.getElementById("username").value
- var password = document.getElementById("password").value
- $.post("http://c46a5489.natappfree.cc/register",
- {username: username, password: password}, function (result) {
- if (result.success) {
- location.href = "/js-demo-day02/js-demo-day02/demo/login.html"
- } else {
- alert(result.msg)
- }
- })
- }
- </script>
- </body>
- </html>
|