151 lines
4.2 KiB
Plaintext
151 lines
4.2 KiB
Plaintext
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>系统用户</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
background-color: #f0f8ff; /* 天蓝色背景 */
|
|
color: #333; /* 深色文本 */
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
h2 {
|
|
color: #4682b4; /* 天蓝色标题 */
|
|
margin-top: 20px;
|
|
}
|
|
|
|
h1 {
|
|
color: #4682b4; /* 天蓝色产品列表标题 */
|
|
margin-top: 20px;
|
|
}
|
|
|
|
a {
|
|
color: #4682b4;
|
|
text-decoration: none;
|
|
margin: 0 10px;
|
|
}
|
|
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
table {
|
|
width: 80%;
|
|
margin-top: 20px;
|
|
border-collapse: collapse;
|
|
background-color: #fff;
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
border-radius: 8px;
|
|
}
|
|
|
|
th, td {
|
|
padding: 12px;
|
|
text-align: left;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
th {
|
|
background-color: #4682b4;
|
|
color: white;
|
|
}
|
|
|
|
tr:nth-child(even) {
|
|
background-color: #f2f2f2;
|
|
}
|
|
|
|
tr:hover {
|
|
background-color: #e6f7ff;
|
|
}
|
|
|
|
.pagination {
|
|
margin-top: 20px;
|
|
text-align: center;
|
|
}
|
|
|
|
.pagination a {
|
|
padding: 8px 16px;
|
|
margin: 0 5px;
|
|
background-color: #4682b4;
|
|
color: white;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.pagination a:hover {
|
|
background-color: #5a9bd3;
|
|
}
|
|
|
|
.message {
|
|
text-align: center;
|
|
margin-top: 20px;
|
|
color: #d9534f; /* 红色错误信息 */
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<h2>电脑商城</h2>
|
|
<p>你好!${sessionScope.user.username}</p>
|
|
<c:if test="${sessionScope.user!= null}">
|
|
<a href="/computer?action=list">电脑选购</a>
|
|
<c:if test="${sessionScope.user.role == 'user'}">
|
|
<a href="/cart?action=list">我的购物车</a>
|
|
<a href="/orders?action=my">我的订单</a>
|
|
</c:if>
|
|
|
|
<c:if test="${sessionScope.user.role == 'admin'}">
|
|
<a href="/user?action=list">用户列表</a>
|
|
<a href="/orders?action=all">所有订单</a>
|
|
</c:if>
|
|
<a href="/logout">退出</a>
|
|
|
|
</c:if>
|
|
<c:if test="${sessionScope.user == null}">
|
|
<p>请登录后查看更多内容~</p>
|
|
<br>
|
|
<a href="/register">注册</a>
|
|
<a href="/login">登录</a>
|
|
</c:if>
|
|
</div>
|
|
|
|
<h1>系统用户</h1>
|
|
<table border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>用户名</th>
|
|
<th>手机号</th>
|
|
<th>身份标识</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<c:forEach var="user" items="${userList}">
|
|
<tr>
|
|
<td>${user.id}</td>
|
|
<td>${user.username}</td>
|
|
<td>${user.phone}</td>
|
|
<td>${user.role}</td>
|
|
<td>
|
|
<a href="javascript:void(0)" >Delete</a>
|
|
</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</tbody>
|
|
</table>
|
|
<br/>
|
|
<!-- <a href="/adduser">Add New user</a> -->
|
|
|
|
</body>
|
|
</html>
|