让用户ID抓包不泄露更安全

This commit is contained in:
limqhz
2022-05-09 23:09:37 +08:00
parent fe275a4df6
commit 1826e4bb9a
1378 changed files with 1486 additions and 91442 deletions

View File

@@ -17,12 +17,12 @@
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom border-gray pb-2 mb-0">
论坛累计:
<span th:text="${pageParam.getTotal()}"></span>
<span th:text="${myPageParam.getTotal()}"></span>
</h6>
<!-- 时间 -->
<div th:each="blog:${blogList}" class="media pt-3 border-bottom border-gray">
<!-- 头像 -->
<img th:src="${blog.getAuthorAvatar()}" style="border-radius: 5px " width="32" height="32">
<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()}}"
@@ -30,14 +30,14 @@
<span th:if="${blog.getSort() == 1}" class="badge badge-danger">置顶</span>
[[${blog.getTitle()}]]
</a>
<p class="float-right" th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd')}"></p>
<p class="float-right" th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd HH:mm:ss')}"></p>
<div class="small">
<!-- 作者 -->
<span>
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-brush-fill" viewBox="0 0 16 16">
<path d="M15.825.12a.5.5 0 0 1 .132.584c-1.53 3.43-4.743 8.17-7.095 10.64a6.067 6.067 0 0 1-2.373 1.534c-.018.227-.06.538-.16.868-.201.659-.667 1.479-1.708 1.74a8.118 8.118 0 0 1-3.078.132 3.659 3.659 0 0 1-.562-.135 1.382 1.382 0 0 1-.466-.247.714.714 0 0 1-.204-.288.622.622 0 0 1 .004-.443c.095-.245.316-.38.461-.452.394-.197.625-.453.867-.826.095-.144.184-.297.287-.472l.117-.198c.151-.255.326-.54.546-.848.528-.739 1.201-.925 1.746-.896.126.007.243.025.348.048.062-.172.142-.38.238-.608.261-.619.658-1.419 1.187-2.069 2.176-2.67 6.18-6.206 9.117-8.104a.5.5 0 0 1 .596.04z"/>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
</svg>
[[${blog.getAuthorName()}]]
[[${blog.getUsername()}]]
</span>
<!-- 浏览量 -->
<span>
@@ -60,20 +60,20 @@
<!--分页-->
<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" th:href="@{'/blog/'+${pageParam.getCurrent()-1}+'/10'}" tabindex="">Previous</a>
<li th:class="${myPageParam.hasPrevious()==true?'page-item':'page-item disabled'}">
<a class="page-link" th:href="@{'/blog/'+${myPageParam.getCurrent()-1}+'/10'}" tabindex="">Previous</a>
</li>
<li class="page-item" th:if="${pageParam.hasPrevious()}">
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()-1}+'/10'}" th:text="${pageParam.getCurrent()-1}"></a>
<li class="page-item" th:if="${myPageParam.hasPrevious()}">
<a class="page-link" th:href="@{'/blog/'+${myPageParam.getCurrent()-1}+'/10'}" th:text="${myPageParam.getCurrent()-1}"></a>
</li>
<li class="page-item active">
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()}+'/10'}" th:text="${pageParam.getCurrent()}"></a>
<a class="page-link" th:href="@{'/blog/'+${myPageParam.getCurrent()}+'/10'}" th:text="${myPageParam.getCurrent()}"></a>
</li>
<li class="page-item" th:if="${pageParam.hasNext()}">
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()+1}+'/10'}" th:text="${pageParam.getCurrent()+1}"></a>
<li class="page-item" th:if="${myPageParam.hasNext()}">
<a class="page-link" th:href="@{'/blog/'+${myPageParam.getCurrent()+1}+'/10'}" th:text="${myPageParam.getCurrent()+1}"></a>
</li>
<li th:class="${pageParam.hasNext()==true?'page-item':'page-item disabled'}">
<a class="page-link" th:href="@{'/blog/'+${pageParam.getCurrent()+1}+'/10'}" >Next</a>
<li th:class="${myPageParam.hasNext()==true?'page-item':'page-item disabled'}">
<a class="page-link" th:href="@{'/blog/'+${myPageParam.getCurrent()+1}+'/10'}" >Next</a>
</li>
</ul>
</nav>
@@ -91,22 +91,20 @@
</div>
<div class="p-4 my-3 bg-white rounded">
<p class="mb-0">
<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"/>
<path d="M4.268 1A2 2 0 0 1 6 0h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L13 13.768V2a1 1 0 0 0-1-1H4.268z"/>
</svg>
敲黑板
<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"/>
<path d="M4.268 1A2 2 0 0 1 6 0h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L13 13.768V2a1 1 0 0 0-1-1H4.268z"/>
</svg>
<br> 如果发的帖子水分过大,可能会被封禁账号,请酌情发帖评论! </p>
</strong>
<br/>
<span>如果发的帖子水分过大,可能会被封禁账号,请酌情发帖评论!</span>
</div>
<div class="p-4 my-3 bg-white rounded">
<h4 class="font-italic pb-3">推荐</h4>
<ul class="list-unstyled" th:each="topBlog:${topBlogList}">
<h4 class="pb-1">推荐</h4>
<ul class="list-unstyled small" th:each="topBlog:${topBlogList}">
<li>
<a class="text-dark text-decoration-none" th:href="@{'/blog/read/'+${topBlog.getBid()}}">
<span class="badge badge-dark">

View File

@@ -5,6 +5,7 @@
<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}">
<link rel="stylesheet" th:href="@{/wangedit/css/wang.style.css}"/>
<style>
.nav-underline .nav-link {
@@ -27,9 +28,9 @@
<div class="blog-post">
<h2 class="blog-post-title" th:text="${blog.getTitle()}"></h2>
<p class="blog-post-meta">
<span th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd')}"></span>
<span th:text="${#dates.format(blog.getGmtUpdate(),'yyyy-MM-dd HH:mm:ss')}"></span>
by
<a href="#" th:text="${blog.getAuthorName()}"></a>
<!-- <a href="#" th:text="${blog.getAuthorName()}"></a>-->
<span>
<svg class="bi bi-eye-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
@@ -40,7 +41,7 @@
<!-- 自己写的文章可以编辑和删除 -->
<a th:if="${session.loginUser.getUid()==blog.getAuthorId()}"
class="float-right text-decoration-none" style="color: red"
th:href="@{'/blog/delete/'+${session.loginUser.getUid()}+'/'+${blog.getBid()}}"
th:href="@{'/blog/delete/'+${blog.getBid()}}"
onclick="if(!confirm('你确认要删除吗?')) return false;">
<svg class="bi bi-x-square" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"/>
@@ -51,7 +52,7 @@
</a>
<a th:if="${session.loginUser.getUid()==blog.getAuthorId()}"
class="float-right mr-3 text-decoration-none"
th:href="@{'/blog/editor/'+${session.loginUser.getUid()}+'/'+${blog.getBid()}}">
th:href="@{'/blog/editor/'+${blog.getBid()}}">
<svg class="bi bi-pencil-square" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456l-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/>
@@ -76,9 +77,8 @@
<hr style="margin-top: 18px">
<!--文章主体内容-->
<div id="doc-content">
<textarea th:text="${blog.getContent()}" style="display:none;" placeholder="markdown"></textarea>
</div>
<div id="editor-text-area" style="height: 400px"></div>
<textarea id="content-textarea" th:text="${blog.getContent()}" name="content" style="display: none;"></textarea>
</div>
@@ -104,11 +104,10 @@
<h6 class="border-bottom border-gray pb-2 mb-0">评论列表</h6>
<div th:each="comment:${commentList}" class="media text-muted pt-3">
<img th:src="${comment.getUserAvatar()}" style="border-radius: 5px;margin-right: 5px " width="32" height="32">
<img th:src="${comment.getAvatar()}" style="border-radius: 5px;margin-right: 5px " width="32" height="32">
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark" th:text="${comment.getUserName()}"></strong>
<strong class="d-block text-gray-dark" th:text="${comment.getUsername()} + '&nbsp;&nbsp;&nbsp;&nbsp;' + ${#dates.format(comment.getGmtCreate(),'yyyy-MM-dd HH:mm:ss')}"></strong>
<span th:text="${comment.getContent()}"></span>
<span th:text="${#dates.format(comment.getGmtCreate(),'yyyy-MM-dd')}" class="badge badge-light float-right"></span>
</p>
</div>
</div>
@@ -132,16 +131,8 @@
<script th:src="@{/js/toTop.js}"></script>
<script th:src="@{/js/jquery-ui.min.js}"></script>
<script th:src="@{/live/js/addlive2d.js}"></script>
<link rel="stylesheet" th:href="@{/editormd/css/editormd.preview.css}" />
<script th:src="@{/editormd/lib/marked.min.js}"></script>
<script th:src="@{/editormd/lib/prettify.min.js}"></script>
<script th:src="@{/editormd/lib/raphael.min.js}"></script>
<script th:src="@{/editormd/lib/underscore.min.js}"></script>
<script th:src="@{/editormd/lib/sequence-diagram.min.js}"></script>
<script th:src="@{/editormd/lib/flowchart.min.js}"></script>
<script th:src="@{/editormd/lib/jquery.flowchart.min.js}"></script>
<script th:src="@{/editormd/editormd.js}"></script>
<script th:src="@{/wangedit/js/wang.min.js}"></script>
<script th:src="@{/wangedit/js/wang.read.js}"></script>
<script type="text/javascript">
function starFun(btn){
btn.disabled = true;
@@ -153,28 +144,10 @@
async: false,
data: {"userId": userId, "topicId": topicId},
success: function (data) {
console.log(data);
$('#id_star_refresh').html(data);
}
});
}
</script>
<script type="text/javascript">
var testEditor;
$(function () {
testEditor = editormd.markdownToHTML("doc-content", {//注意这里是上面DIV的id
htmlDecode: "style,script,iframe",
emoji: true,
taskList: true,
tocm: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true, // 默认不解析
codeFold: true
});});
</script>
</body>
</html>