From c412eb3ef9ad4f84ce44f15e532790eb7b3017d6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 24 Nov 2024 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=9D=99=E6=80=81=E5=86=85=E5=AE=B9]=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0Tips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/wwwroot/index.html | 2 ++ src/wwwroot/query_download_task.html | 1 + src/wwwroot/static/js/custom/Common.js | 37 +++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/wwwroot/index.html b/src/wwwroot/index.html index 7ba28ff..64dccfc 100644 --- a/src/wwwroot/index.html +++ b/src/wwwroot/index.html @@ -47,6 +47,8 @@

查询文件下载任务状态 | 捐赠

+

Tips: 任务列表每个IP相互隔离,不必担心任务信息泄露

+ diff --git a/src/wwwroot/query_download_task.html b/src/wwwroot/query_download_task.html index 650d916..5928fd1 100644 --- a/src/wwwroot/query_download_task.html +++ b/src/wwwroot/query_download_task.html @@ -148,6 +148,7 @@ +

Tips: 任务列表每个IP相互隔离,不必担心任务信息泄露

返回主页 | 捐赠

diff --git a/src/wwwroot/static/js/custom/Common.js b/src/wwwroot/static/js/custom/Common.js index 2a811f0..e4b5cd9 100644 --- a/src/wwwroot/static/js/custom/Common.js +++ b/src/wwwroot/static/js/custom/Common.js @@ -9,4 +9,39 @@ function showLoadingMask() { // 隐藏遮罩层 function hideLoadingMask() { $loadingMask.hide(); -} \ No newline at end of file +} + + +function getRandomInt(min, max) { + min = Math.ceil(min); // 确保 min 是一个整数 + max = Math.floor(max); // 确保 max 是一个整数 + return Math.floor(Math.random() * (max - min + 1)) + min; // 使用 floor 而不是 round 可以确保包括 max 在内 +} +/** + * 生成指定范围内的随机整数 + * @param {number} min - 范围的最小值 + * @param {number} max - 范围的最大值 + * @returns {number} - 在指定范围内的随机整数 + */ +function getRandomInt(min, max) { + min = Math.ceil(min); // 确保 min 是一个整数 + max = Math.floor(max); // 确保 max 是一个整数 + // 使用 floor 而不是 round 可以确保包括 max 在内 + return Math.floor(Math.random() * (max - min + 1)) + min; +} + + +let tipsStr = [ + "任务列表每个IP相互隔离,不必担心任务信息泄露。", + "哈希算法为MD5。", + "下载的文件不会永久存储在服务器上, 每隔一段时间服务器会自动清理那些文件, 并且任务状态会转变为 “已被清理”。", + "本站会收集一些访客信息用于访客数据分析, 若你不想被收集相关信息用于分析, 请点我自助删除已经存储在服务器上的信息(新加任务仍然会收集)。", + "服务器同时下载的任务达到限制时候, 新的任务会被加入队列(即 排队), 若队列达到管理员设置的最大值则不再接受新任务, 直至队列空出余量。", + "本站为了节省成本和照顾其他访客的感受, 每个IP有一定的下载和任务提交配额, 达到限制后当天内不能再下载文件或者新增任务, 请勿浪费公共资源。" +]; + +$(document).ready(function () { + let tips = tipsStr[getRandomInt(0, tipsStr.length - 1)]; + console.log(tips); + $('#tips').html(tips); +}); \ No newline at end of file