fix 恶意刷新查看量
全局搜索代替了原来长连接的方式,增加了很多隐藏的门路。
This commit is contained in:
@@ -5,7 +5,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>论坛-Quinn</title>
|
||||
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
||||
|
||||
<style>
|
||||
#maxLength {
|
||||
max-width: 500px;
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分不显示 */
|
||||
text-overflow: ellipsis; /* 超出部分显示为... */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background: #f2f2f2;">
|
||||
|
||||
@@ -25,7 +32,7 @@
|
||||
<img th:src="${blog.getAvatar()}" style="border-radius: 5px " width="32" height="32">
|
||||
<div class="media-body small pl-2">
|
||||
<!-- 标题 -->
|
||||
<a th:href="@{'/blog/read/'+${blog.getBid()}}"
|
||||
<a id="maxLength" th:href="@{'/blog/read/'+${blog.getBid()}}"
|
||||
class="text-dark font-weight-bold text-decoration-none">
|
||||
<span th:if="${blog.getSort() == 1}" class="badge badge-danger">置顶</span>
|
||||
[[${blog.getTitle()}]]
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="jumbotron" style="background-color: #ffffff;">
|
||||
<div class="container">
|
||||
<h1 class="display-3">关于我们
|
||||
<a style="font-size: 12px;" href="javascript:donate();" class="badge badge-pill badge-danger text-decoration-none">赞助服务器</a>
|
||||
<a style="font-size: 14px;" href="javascript:donate();" class="badge badge-danger text-decoration-none">赞助服务器</a>
|
||||
</h1>
|
||||
<div class="alert alert-primary mt-3" role="alert">
|
||||
广罗优质资源,服务优质的你!
|
||||
|
||||
99
src/main/resources/templates/page/allsearch.html
Normal file
99
src/main/resources/templates/page/allsearch.html
Normal file
@@ -0,0 +1,99 @@
|
||||
<!doctype html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>论坛-Quinn</title>
|
||||
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
||||
<style>
|
||||
#maxLength {
|
||||
max-width: 500px;
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分不显示 */
|
||||
text-overflow: ellipsis; /* 超出部分显示为... */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background: #f2f2f2;">
|
||||
|
||||
<div th:replace="~{common/header::header(activeUrl='blog')}"></div>
|
||||
|
||||
<main role="main" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 blog-main">
|
||||
<div class="my-3 p-3 bg-white rounded shadow-sm">
|
||||
<div th:fragment="user_table_refresh" th:id="id_user_table_refresh" >
|
||||
<h6 class="border-bottom border-gray pb-2 mb-0">
|
||||
论坛累计:
|
||||
<span th:text="${pageParam.getTotal()}"></span>
|
||||
</h6>
|
||||
<div th:each="star:${starList}" class="media text-muted pt-1">
|
||||
<p class="media-body pb-1 mb-0 small lh-125 border-bottom border-gray" style="margin-left: 5px">
|
||||
<!-- 标题 -->
|
||||
<a th:text="${star.getTopicName()}"
|
||||
th:href="@{${star.getTopicCategory()=='BLOG'?'/blog/read/':'/source/view/'} + ${star.getTopicId()}}"
|
||||
class="text-dark font-weight-bold text-decoration-none d-block">
|
||||
</a>
|
||||
<!-- 类型 -->
|
||||
<span th:text="${star.getTopicCategory()=='BLOG'?'论坛':'资源'}"
|
||||
th:class="${star.getTopicCategory()=='BLOG'?'badge badge-success':'badge badge-primary'}">
|
||||
</span>
|
||||
<!-- 时间 -->
|
||||
<span th:text="${#dates.format(star.getGmtCreate(),'yyyy-MM-dd HH:mm:ss')}"
|
||||
class="float-right">
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<!--分页-->
|
||||
<nav aria-label="Page navigation example" class="mt-4">
|
||||
<ul class="pagination justify-content-center pagination-sm">
|
||||
<li th:class="${pageParam.hasPrevious()==true?'page-item':'page-item disabled'}">
|
||||
<a class="page-link" href="javascript:navChange(-1);" tabindex="">Previous</a>
|
||||
</li>
|
||||
<li class="page-item" th:if="${pageParam.hasPrevious()}">
|
||||
<a class="page-link" href="javascript:navChange(-1);" th:text="${pageParam.getCurrent()-1}"></a>
|
||||
</li>
|
||||
<li class="page-item active">
|
||||
<a id = "current" class="page-link" href="javascript:navChange(0);" th:text="${pageParam.getCurrent()}"></a>
|
||||
</li>
|
||||
<li class="page-item" th:if="${pageParam.hasNext()}">
|
||||
<a class="page-link" href="javascript:navChange(1);" th:text="${pageParam.getCurrent()+1}"></a>
|
||||
</li>
|
||||
<li th:class="${pageParam.hasNext()==true?'page-item':'page-item disabled'}">
|
||||
<a class="page-link" href="javascript:navChange(1);">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<div th:replace="~{common/footer::footer}"></div>
|
||||
|
||||
<a class="to-top">返回顶部</a>
|
||||
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
||||
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
||||
<script th:src="@{/js/toTop.js}"></script>
|
||||
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
||||
<script th:src="@{/live/js/addlive2d.js}"></script>
|
||||
<script type="text/javascript">
|
||||
function navChange(page){
|
||||
var current = $('#current').text();
|
||||
var pageNum = parseInt(current) + page;
|
||||
$.ajax({
|
||||
url: "/blog",
|
||||
async: false,
|
||||
type: "post",
|
||||
data: {"pageNum": pageNum, "limit": 10},
|
||||
success: function (data) {
|
||||
$('#id_s_table_refresh').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,7 +5,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>资源库-Quinn</title>
|
||||
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
||||
|
||||
<style>
|
||||
#maxLength {
|
||||
max-width: 500px;
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分不显示 */
|
||||
text-overflow: ellipsis; /* 超出部分显示为... */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -18,17 +25,20 @@
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-1 row-cols-md-3 text-center">
|
||||
<div class="col mb-4" th:each="source:${sourceList}">
|
||||
<div class="col mb-3" th:each="source:${sourceList}">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="font-weight-normal">
|
||||
<a class="text-dark font-weight-bold text-decoration-none" th:href="@{'/source/view/'+${source.getSid()}}">
|
||||
<h4 class="font-weight-normal d-inline">
|
||||
[[${source.getSourceName()}]]
|
||||
<span style="font-size: 8px;" class="badge badge-pill badge-danger">Quinn</span>
|
||||
</h4>
|
||||
<span class="badge badge-danger">
|
||||
[[${source.getCategoryName()}]]
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p th:text="${source.getDetail()}"></p>
|
||||
<a th:href="@{'/source/view/'+${source.getSid()}}" class="btn btn-sm btn-outline-success">查看详情</a>
|
||||
<p id="maxLength" th:text="${source.getDetail()}"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body style="background: #f2f2f2;">
|
||||
|
||||
<div th:replace="~{common/header::header(activeUrl='source')}"></div>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
[[${source.getSourceName()}]]
|
||||
</a>
|
||||
<!-- 收藏 -->
|
||||
<span class="badge badge-dark">
|
||||
<span class="badge badge-primary">
|
||||
[[${source.getCategoryName()}]]
|
||||
(
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
|
||||
@@ -77,7 +77,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<aside class="col-md-3 blog-sidebar">
|
||||
<div class="p-1 my-2 bg-white rounded">
|
||||
<div class="p-4 my-3 bg-white rounded">
|
||||
<strong class="mb-0">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bookmarks-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L7 13.101l-4.223 2.815A.5.5 0 0 1 2 15.5V4z"/>
|
||||
@@ -86,12 +86,12 @@
|
||||
敲黑板
|
||||
</strong>
|
||||
<br/>
|
||||
<span>如果发的帖子水分过大,可能会被封禁账号,请酌情发帖评论!</span>
|
||||
<span>按照资源名称进行模糊查询,如需含内容模糊,您可以使用【↑全站搜索↑】</span>
|
||||
</div>
|
||||
<div class="p-1 my-2 bg-white rounded">
|
||||
<div class="p-3 my-3 bg-white rounded">
|
||||
<form action="javascript:navChange(0);" method="post">
|
||||
<div class="form-row align-items-center">
|
||||
<div class="col-md-12 form-control-sm">
|
||||
<div class="form-row">
|
||||
<div class="col-md-12 mt-2">
|
||||
<label class="sr-only" for="name">KEYWORD</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
@@ -100,7 +100,7 @@
|
||||
<input type="text" class="form-control" id="name" name="name" placeholder="请输入关键字"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-3 form-control-sm">
|
||||
<div class="col-md-12 mt-2">
|
||||
<label class="sr-only" for="category">SOURCE-TYPE</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
@@ -113,9 +113,12 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12 mt-3 form-control-sm">
|
||||
<div class="col-md-12 mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-block">查询</button>
|
||||
</div>
|
||||
<div class="col-md-12 mt-2">
|
||||
<button onclick="clearAll(this)" type="submit" class="btn btn-primary btn-block">清空</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -147,6 +150,11 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
function clearAll(btn){
|
||||
$('#name').val('');
|
||||
$('#category').val(-1);
|
||||
this.submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<div class="source-post">
|
||||
<h2 class="source-post-title" th:text="${source.getSourceName()}"></h2>
|
||||
<p class="source-post-meta">
|
||||
上传时间:
|
||||
<span class="badge-pill badge-primary" th:text="${source.getCategoryName()}">
|
||||
</span>
|
||||
<span th:text="${#dates.format(source.getGmtUpdate(),'yyyy-MM-dd HH:mm:ss')}"></span>
|
||||
类别-
|
||||
<span th:text="${source.getCategoryName()}"></span>
|
||||
<span class="ml-1">
|
||||
<a class="text-danger text-decoration-none" th:fragment="star_refresh" th:id="id_star_refresh"
|
||||
href="javascript:starFun(this);">
|
||||
@@ -33,7 +32,7 @@
|
||||
<svg th:if="${starValue.isStar() != true}" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart" viewBox="0 0 16 16">
|
||||
<path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z"/>
|
||||
</svg>
|
||||
收藏
|
||||
[[${starValue.getTotal()}]]
|
||||
</a>
|
||||
</span>
|
||||
<a href="javascript:downloadFile(this);" class="btn btn-outline-success col-md-2 float-right">下载</a>
|
||||
@@ -134,6 +133,7 @@
|
||||
async: false,
|
||||
data: {"userId": userId, "topicId": topicId},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
$('#id_star_refresh').html(data);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user