31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
<html>
|
|
<body>
|
|
<script src="https://www.liyansheng.top/cdn/watermark.js"></script>
|
|
<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>
|
|
|
|
|
|
</body>
|
|
</html> |