mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-16 23:22:20 +08:00
添加链接失效反馈后端及数据库;登陆改为登录
This commit is contained in:
@@ -368,7 +368,7 @@
|
||||
toggleDisplayButton();
|
||||
} else {
|
||||
if (data.errCode == "20004") {
|
||||
// 登陆过期,小问题,这里不弹窗显示
|
||||
// 登录过期,小问题,这里不弹窗显示
|
||||
localStorageUtils.userLogout();
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
@@ -501,11 +501,11 @@
|
||||
<div class="file-object-item-content">${content}</div>
|
||||
<div class="file-object-item-link">${downloadLink}</div>
|
||||
<div class="outdated-feedback">
|
||||
<img src="/assets/image/svg/feedback.svg"/>
|
||||
<img src="/assets/image/svg/feedback.svg" onclick="linkFeedback(${fileObjectInfo.fileId},${fileObjectInfo.id});"/>
|
||||
<span class="outdated-feedback-tip">链接失效?点击反馈!</span>
|
||||
</div>
|
||||
</div>`.replace(/\ [ ]+?/g,"").replace(/[\n]/g,"") //去掉多余空格、换行
|
||||
console.log(dom);
|
||||
// console.log(dom);
|
||||
return dom;
|
||||
}
|
||||
getRequest("/file/getFile", { bookId: bookId })
|
||||
@@ -550,7 +550,7 @@
|
||||
</div>`
|
||||
);
|
||||
}
|
||||
fileContainer.innerHTML += innerHTML.join("");
|
||||
fileContainer.innerHTML = innerHTML.join("");
|
||||
|
||||
if (innerHTML.length == 0) {
|
||||
var fileItem = document.createElement("div");
|
||||
@@ -623,5 +623,39 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
// 链接失效反馈
|
||||
function linkFeedback(fileId, fileObjectId) {
|
||||
if (!confirm("确定这个下载链接失效了吗?(没失效的链接不可以乱点着玩儿哦)"))
|
||||
return;
|
||||
|
||||
if (!localStorageUtils.getLoginStatus()) {
|
||||
if (confirm("您尚未登录,登录后反馈处理更快,是否前往登录?")) {
|
||||
location.href = "/login?redirect=" + encodeURIComponent(location.pathname + location.search);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
postRequest("/file/object/FailureFeedback", { bookId: bookId, fileId: fileId, fileObjectId: fileObjectId, token: localStorageUtils.getToken() })
|
||||
.then(function (response) {
|
||||
var axiosData = response.data;
|
||||
var status = axiosData.status;
|
||||
var data = axiosData.data;
|
||||
if (status === "success") {
|
||||
// console.log(data);
|
||||
if (data) {
|
||||
alert("真棒!反馈成功!");
|
||||
} else {
|
||||
alert("反馈失败,请稍后再试!");
|
||||
}
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
alert("无法连接到服务器,请检查网络连接!");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -52,7 +52,7 @@
|
||||
window.location.href = "/login";
|
||||
}
|
||||
} else {
|
||||
if(data.errCode == "20004") { // 登陆过期
|
||||
if(data.errCode == "20004") { // 登录过期
|
||||
localStorageUtils.userLogout();
|
||||
window.location.href = "/login";
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
if (data.errCode == "20004") {
|
||||
// 登陆过期
|
||||
// 登录过期
|
||||
localStorageUtils.userLogout();
|
||||
location.href = "/login";
|
||||
}
|
||||
|
@@ -3,11 +3,6 @@
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 20px auto;
|
||||
position: relative;
|
||||
@@ -53,7 +48,7 @@
|
||||
user-select: all;
|
||||
}
|
||||
|
||||
p {
|
||||
.main p {
|
||||
font-size: 14px !important;
|
||||
font-family: initial !important;
|
||||
}
|
||||
@@ -65,7 +60,7 @@
|
||||
<h1><%= headText %></h1>
|
||||
<div id="container">
|
||||
<p>
|
||||
<br>反馈前请选择正确的分类,否则反馈经过二次转接,响应时间将会变长。
|
||||
反馈前请选择正确的分类,否则反馈经过二次转接,响应时间将会变长。
|
||||
</p>
|
||||
<div class="wrap">
|
||||
<label>
|
||||
@@ -95,7 +90,7 @@
|
||||
<br>
|
||||
</p>
|
||||
<p>
|
||||
请点击链接旁的 <img src="/assets/image/svg/feedback.svg" style="width: 1em; height: 1em;"/> 按钮进行反馈。
|
||||
请前往下载页面,点击链接旁的 <img src="/assets/image/svg/feedback.svg" style="width: 1em; height: 1em;"/> 按钮进行反馈。
|
||||
</p>
|
||||
</div>
|
||||
</label>
|
||||
@@ -141,16 +136,8 @@
|
||||
</main>
|
||||
<%- include("./component/footer.html"); %>
|
||||
|
||||
<!-- 获取参数 -->
|
||||
<script src="/assets/javascripts/getParams.js"></script>
|
||||
<!-- 点击复制及反馈样式 -->
|
||||
<script src="/assets/javascripts/cssUtils.js"></script>
|
||||
<script>
|
||||
var requestParams = getParams();
|
||||
// var searchbox = document.getElementById("searchInput");
|
||||
// var categoryId = requestParams["id"] ?? "";
|
||||
// console.log("categoryId", categoryId);
|
||||
</script>
|
||||
<script>
|
||||
// 点击复制
|
||||
$(".click2copy").click(function (e) {
|
||||
|
@@ -78,6 +78,8 @@
|
||||
|
||||
<!-- <script src="/assets/lib/cryptography/2.2/md5-min.js"></script> -->
|
||||
<!-- <script src="/assets/lib/cryptography/2.2/sha1-min.js"></script> -->
|
||||
<!-- 获取参数 -->
|
||||
<script src="/assets/javascripts/getParams.js"></script>
|
||||
<script>
|
||||
// 避免重复点击
|
||||
var isOnLogin = false;
|
||||
@@ -137,6 +139,17 @@
|
||||
token: data.token,
|
||||
is_admin: data.group === "ADMIN",
|
||||
});
|
||||
// 用户登录成功
|
||||
|
||||
// 如果指定了 Redirect 链接,则跳到指定链接
|
||||
var requestParams = getParams();
|
||||
var redirectUrl = requestParams["redirect"] ?? "";
|
||||
if (redirectUrl) {
|
||||
location.href = location.origin + redirectUrl;
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果没有指定 Redirect 链接,则跳到后台
|
||||
if (localStorageUtils.getIsAdmin()) {
|
||||
window.location.href = "/dashboard/admin/index";
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user