让用户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

@@ -5,6 +5,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}">
<link rel="stylesheet" th:href="@{/wangedit/css/wang.style.css}"/>
</head>
<body style="background: #f2f2f2;">
@@ -19,9 +21,21 @@
<h2 class="source-post-title" th:text="${source.getSourceName()}"></h2>
<p class="source-post-meta">
上传时间:
<span th:text="${#dates.format(source.getGmtUpdate(),'yyyy-MM-dd')}"></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);">
<svg th:if="${starValue.isStar() == true}" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-heart-fill" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"/>
</svg>
<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>
收藏
</a>
</span>
<a href="javascript:downloadFile(this);" class="btn btn-outline-success col-md-2 float-right">下载</a>
</p>
</div>
@@ -34,9 +48,8 @@
<hr style="margin-top: 18px">
<!--文章主体内容-->
<div id="doc-content">
<textarea th:text="${source.getSourceContent()}" style="display:none;" placeholder="markdown"></textarea>
</div>
<div id="editor-text-area" style="height: 400px"></div>
<textarea id="content-textarea" th:text="${source.getSourceContent()}" name="content" style="display: none;"></textarea>
</div>
@@ -46,7 +59,7 @@
<div class="col-md-12 source-main" style="margin-top: 20px">
<form th:action="@{'/source/comment/'+${source.getSid()}}" method="post">
<input type="hidden" name="userId" th:value="${session.loginUser.getUid()}">
<input type="hidden" id="userId" name="userId" th:value="${session.loginUser.getUid()}">
<input type="hidden" name="userName" th:value="${session.loginUser.getUsername()}">
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
<input type="hidden" id="topicId" name="topicId" th:value="${source.getSid()}">
@@ -64,9 +77,8 @@
<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">
<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>
@@ -90,17 +102,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 downloadFile(btn){
btn.disabled=true;
@@ -120,21 +123,21 @@
});
}
}
</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>
function starFun(btn){
btn.disabled = true;
var userId = $('#userId').val();
var topicId = $('#topicId').val();
$.ajax({
url: "/source/star",
type: "post",
async: false,
data: {"userId": userId, "topicId": topicId},
success: function (data) {
$('#id_star_refresh').html(data);
}
});
}
</script>
</body>
</html>