|
|
|
|
@ -21,132 +21,220 @@
|
|
|
|
|
Time: 3:51
|
|
|
|
|
To change this template use File | Settings | File Templates.
|
|
|
|
|
--%>
|
|
|
|
|
<%--
|
|
|
|
|
页面指令,设置页面的内容类型、字符集、脚本语言和页面编码。
|
|
|
|
|
contentType 指定了返回给客户端的内容类型为 HTML,并使用 UTF-8 编码。
|
|
|
|
|
language 指定了页面中使用的脚本语言为 Java。
|
|
|
|
|
pageEncoding 明确指定了页面本身的编码为 UTF-8,虽然通常与 contentType 中的 charset 相同,但在这里为了清晰起见还是单独设置了。
|
|
|
|
|
--%>
|
|
|
|
|
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
引入 JSTL 核心标签库,前缀为 c。
|
|
|
|
|
这允许我们在 JSP 页面中使用 JSTL 标签,如 <c:set>、<c:if> 等。
|
|
|
|
|
--%>
|
|
|
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
使用 <c:set> 标签设置一个名为 host 的变量,其值为 "localhost:8080/wechat"。
|
|
|
|
|
这个变量稍后在页面中用于构建 URL。
|
|
|
|
|
--%>
|
|
|
|
|
<c:set var="host" value="localhost:8080/wechat"/>
|
|
|
|
|
<%--设置主机名--%>
|
|
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<title>wechat</title>
|
|
|
|
|
<link rel="shortcut icon" type=image/x-icon href=https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico>
|
|
|
|
|
<meta charset="utf-8"> <%-- 设置页面的字符集为 UTF-8 --%>
|
|
|
|
|
<title>wechat</title> <%-- 页面标题 --%>
|
|
|
|
|
|
|
|
|
|
<%-- 引入微信图标 --%>
|
|
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico">
|
|
|
|
|
|
|
|
|
|
<%-- 引入 Bootstrap CSS 框架 --%>
|
|
|
|
|
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
|
|
|
|
|
|
|
|
|
<%-- 引入 jQuery 库 --%>
|
|
|
|
|
<script src="${pageContext.request.contextPath}/static/js/jquery-3.4.1.js"></script>
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
发送请求脚本的占位符,目前为空。
|
|
|
|
|
可以在这里添加 JavaScript 代码来处理发送请求的逻辑。
|
|
|
|
|
--%>
|
|
|
|
|
<!--BEGIN——发送请求脚本-->
|
|
|
|
|
<!--END——发送请求脚本-->
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<%-- 页面背景容器 --%>
|
|
|
|
|
<div class="background">
|
|
|
|
|
<%-- 页面头部--%>
|
|
|
|
|
|
|
|
|
|
<%-- 页面头部 --%>
|
|
|
|
|
<div class="login-head" style="height: 100px">
|
|
|
|
|
|
|
|
|
|
<%-- 使用 Bootstrap 的 jumbotron 类来创建一个醒目的容器 --%>
|
|
|
|
|
<div class="jumbotron" style="padding-bottom: 20px;padding-top:20px;margin:0px">
|
|
|
|
|
|
|
|
|
|
<%-- 包含微信 logo 和标语的区域 --%>
|
|
|
|
|
<div class="logo">
|
|
|
|
|
<a href="${pageContext.request.contextPath}/index.jsp"
|
|
|
|
|
style="color: #999;font-size: 44px;text-decoration: none"><img
|
|
|
|
|
src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo"
|
|
|
|
|
style="width: 100px;margin: 10px">微信,是一种生活方式</h2>
|
|
|
|
|
</a>
|
|
|
|
|
style="color: #999;font-size: 44px;text-decoration: none">
|
|
|
|
|
<img src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo"
|
|
|
|
|
style="width: 100px;margin: 10px">
|
|
|
|
|
<%-- 注意:这里的 <h2> 标签被错误地关闭了,应该使用 </a> 来关闭 <a> 标签,而不是 </h2> --%>
|
|
|
|
|
微信,是一种生活方式</a> <%-- 这里应该使用正确的 HTML 结构,但原代码有误,已按原样注释 --%>
|
|
|
|
|
</a> <%-- 这是一个多余的闭合标签,应该删除 --%>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
使用 <c:if> 标签检查 message 变量是否不为 null。
|
|
|
|
|
如果不为 null,则使用 JavaScript 显示一个警告框。
|
|
|
|
|
--%>
|
|
|
|
|
<script>
|
|
|
|
|
<c:if test="${message!=null}">
|
|
|
|
|
alert("系统提示:${message}");
|
|
|
|
|
</c:if>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<%-- 输入框容器 --%>
|
|
|
|
|
<div class="input-box">
|
|
|
|
|
|
|
|
|
|
<%-- 输入字段的容器,带有自定义样式 --%>
|
|
|
|
|
<div class="color-input-field">
|
|
|
|
|
<form action="http://${host}/wechat/user?method=login.do" method="post">
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
表单,提交到 http://${host}/wechat/user?method=login.do。
|
|
|
|
|
使用 POST 方法提交。
|
|
|
|
|
--%>
|
|
|
|
|
<form action="http://${host}/wechat/user?method=login.do" method="post">
|
|
|
|
|
|
|
|
|
|
<%--
|
|
|
|
|
一个隐藏的提交按钮,可能用于触发某些 JavaScript 事件,但在这里被设置为不显示。
|
|
|
|
|
--%>
|
|
|
|
|
<input id="index" type="submit" style="display: none">
|
|
|
|
|
<h2 class="input-box-title">邮箱登陆</h2>
|
|
|
|
|
<input type="text" required="required" class="form-control" id="email"
|
|
|
|
|
value="${param.email}" name="email" placeholder="请输入登陆邮箱" >
|
|
|
|
|
<br/>
|
|
|
|
|
<input id="password" type="password" required="required" class="form-control" name="password"
|
|
|
|
|
placeholder="请输入密码">
|
|
|
|
|
<div class="remember-me">
|
|
|
|
|
<input id="option" name="auto_login" type="checkbox" value="true">记住登陆
|
|
|
|
|
</div>
|
|
|
|
|
<input type="submit" class="submit-button" value="登陆">
|
|
|
|
|
<br>
|
|
|
|
|
<div class="switch-button">
|
|
|
|
|
<a href="${pageContext.request.contextPath}/register.jsp">立即注册</a>
|
|
|
|
|
<a href="http://${host}/wechat/user?method=login.do&email=visitor" onclick="visitor()">| 游客模式</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%-- 输入框标题 --%>
|
|
|
|
|
<h2 class="input-box-title">邮箱登陆</h2>
|
|
|
|
|
|
|
|
|
|
<%-- 邮箱输入框,带有占位符和必填验证 --%>
|
|
|
|
|
<input type="text" required="required" class="form-control" id="email"
|
|
|
|
|
value="${param.email}" name="email" placeholder="请输入登陆邮箱">
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<%-- 密码输入框,带有占位符和必填验证 --%>
|
|
|
|
|
<input id="password" type="password" required="required" class="form-control" name="password"
|
|
|
|
|
placeholder="请输入密码">
|
|
|
|
|
|
|
|
|
|
<%-- 记住登陆选项 --%>
|
|
|
|
|
<div class="remember-me">
|
|
|
|
|
<input id="option" name="auto_login" type="checkbox" value="true">记住登陆
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%-- 提交按钮 --%>
|
|
|
|
|
<input type="submit" class="submit-button" value="登陆">
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
<%-- 切换按钮,包含注册链接和游客模式链接 --%>
|
|
|
|
|
<div class="switch-button">
|
|
|
|
|
<a href="${pageContext.request.contextPath}/register.jsp">立即注册</a>
|
|
|
|
|
<%--
|
|
|
|
|
游客模式链接,带有 onclick 事件处理器(尽管这里没有定义 visitor() 函数,可能需要在 JavaScript 中定义)。
|
|
|
|
|
注意:这里的 URL 拼接方式可能会导致安全问题,建议使用更安全的参数传递方式。
|
|
|
|
|
--%>
|
|
|
|
|
<a href="http://${host}/wechat/user?method=login.do&email=visitor" onclick="visitor()">| 游客模式</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
<!-- 网页的结束body标签,通常表示HTML文档的主体内容结束 -->
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
<!-- 定义CSS样式 -->
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
/* 设置背景样式 */
|
|
|
|
|
.background {
|
|
|
|
|
height: -webkit-fill-available;
|
|
|
|
|
min-height: 750px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
background-color: #f1f1f1;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
height: -webkit-fill-available; /* 高度填充可用空间(针对webkit浏览器) */
|
|
|
|
|
min-height: 750px; /* 最小高度 */
|
|
|
|
|
text-align: center; /* 文本居中 */
|
|
|
|
|
font-size: 14px; /* 字体大小 */
|
|
|
|
|
background-color: #f1f1f1; /* 背景颜色 */
|
|
|
|
|
z-index: -1; /* 堆叠顺序,设置为-1表示在其他元素之下 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置logo样式 */
|
|
|
|
|
.logo {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 56px;
|
|
|
|
|
margin-left: 50px;
|
|
|
|
|
position: absolute; /* 绝对定位 */
|
|
|
|
|
top: 56px; /* 距离顶部56px */
|
|
|
|
|
margin-left: 50px; /* 距离左侧50px */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置表单控件样式 */
|
|
|
|
|
.form-control {
|
|
|
|
|
padding: 10px;
|
|
|
|
|
min-height: 55px;
|
|
|
|
|
max-height: 70px;
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
padding: 10px; /* 内边距 */
|
|
|
|
|
min-height: 55px; /* 最小高度 */
|
|
|
|
|
max-height: 70px; /* 最大高度 */
|
|
|
|
|
font-size: 22px; /* 字体大小 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置输入框标题样式 */
|
|
|
|
|
.input-box-title {
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto 50px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #969696
|
|
|
|
|
text-align: center; /* 文本居中 */
|
|
|
|
|
margin: 0 auto 50px; /* 上下外边距自动,底部外边距50px */
|
|
|
|
|
padding: 10px; /* 内边距 */
|
|
|
|
|
font-weight: 400; /* 字体粗细 */
|
|
|
|
|
color: #969696 /* 字体颜色 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置颜色输入框样式 */
|
|
|
|
|
.color-input-field {
|
|
|
|
|
padding: 50px;
|
|
|
|
|
font-size: 22px;
|
|
|
|
|
height: 625px;
|
|
|
|
|
width: 500px
|
|
|
|
|
padding: 50px; /* 内边距 */
|
|
|
|
|
font-size: 22px; /* 字体大小 */
|
|
|
|
|
height: 625px; /* 高度 */
|
|
|
|
|
width: 500px /* 宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置输入框容器样式 */
|
|
|
|
|
.input-box {
|
|
|
|
|
width: fit-content;
|
|
|
|
|
margin: 104px auto;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
box-shadow: 0 0 8px rgba(0, 0, 0, .1);
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
width: fit-content; /* 宽度适应内容 */
|
|
|
|
|
margin: 104px auto; /* 上下外边距104px,左右外边距自动 */
|
|
|
|
|
background-color: #fff; /* 背景颜色 */
|
|
|
|
|
border-radius: 4px; /* 边框圆角 */
|
|
|
|
|
box-shadow: 0 0 8px rgba(0, 0, 0, .1); /* 盒子阴影 */
|
|
|
|
|
vertical-align: middle; /* 垂直对齐方式 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置提交按钮样式 */
|
|
|
|
|
.submit-button {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
background-color: #1AAD19;
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
padding: 9px 18px;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
outline: none;
|
|
|
|
|
border: none;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-top: 20px; /* 上外边距 */
|
|
|
|
|
background-color: #1AAD19; /* 背景颜色 */
|
|
|
|
|
color: #FFFFFF; /* 字体颜色 */
|
|
|
|
|
padding: 9px 18px; /* 内边距 */
|
|
|
|
|
border-radius: 5px; /* 边框圆角 */
|
|
|
|
|
outline: none; /* 移除默认轮廓 */
|
|
|
|
|
border: none; /* 无边框 */
|
|
|
|
|
width: 100%; /* 宽度100% */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置记住我选项样式 */
|
|
|
|
|
.remember-me {
|
|
|
|
|
float: left;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #969696;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
float: left; /* 左浮动 */
|
|
|
|
|
font-weight: 400; /* 字体粗细 */
|
|
|
|
|
color: #969696; /* 字体颜色 */
|
|
|
|
|
margin-top: 20px; /* 上外边距 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 设置切换按钮容器样式 */
|
|
|
|
|
.switch-button {
|
|
|
|
|
text-align: left;
|
|
|
|
|
text-align: left; /* 文本左对齐 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
<!-- 网页的结束html标签,表示HTML文档结束 -->
|
|
|
|
|
</html>
|