 th:fragment="tag">

        <th:block
                th:if="${posts.hasPrevious() || posts.hasNext()}"
                th:with="totalPages = ${posts.totalPages}, pageIndex = ${posts.page}">
            <!--        页面总数小于等于7-->
            <nav class=pagination th:if="${(totalPages le 7) && (totalPages gt 0)}">
                <span class="page-link" th:classappend="${index eq pageIndex} ? 'current'"
                    th:each="index : ${#numbers.sequence(1, totalPages)}">
                