Home Tags Posts tagged with "thymeleaf"

thymeleaf

</span>
    <span class="fr">
    <span class="fl" th:if="${session.user == null}">你好,请<a href="/login.html" style="color:#ff4e00;">登录</a>&nbsp;<a href="/register" style="color:#ff4e00;">免费注册</a>&nbsp;&nbsp;</span>
    <span class="fl" th:if="${session.user != null}"><a href="/user/userInfo" >欢迎回来,<span th:text="${session.user.userName}"></span></a>&nbsp;|&nbsp;<a href="/orders/list">我的订单</a>&nbsp;</span>
    <span class="fl" th:if="${session.user != null} and ${session.user.role != 0}">|&nbsp;<a href="/admin/adminIndex">后台管理&nbsp;</a></span>
    <span class="fl" th:if="${session.user != null}">|&nbsp;<a href="/admin/adminIndex">秒杀商品&nbsp;</a></span>
    <span class="fl" th:if="${session.user != null}">|&nbsp;<a href="/user/logout">注销</a></span>
</span>

注意:多条件下使用 th:if 格式为
 <span class="fl" th:if="${session.user != null} and ${session.user.role != 0}">|&nbsp;<a href="/admin/adminIndex">后台管理&nbsp;</a></span>