diff --git a/404.html b/404.html
index a91c56a..36e01b0 100644
--- a/404.html
+++ b/404.html
@@ -38,7 +38,7 @@
-
+
diff --git a/card/keben/index.html b/card/keben/index.html
index 0186031..0169a6a 100644
--- a/card/keben/index.html
+++ b/card/keben/index.html
@@ -38,7 +38,7 @@
-
+
diff --git a/card/qimo/index.html b/card/qimo/index.html
index 1e4346e..9e57190 100644
--- a/card/qimo/index.html
+++ b/card/qimo/index.html
@@ -38,7 +38,7 @@
-
+
diff --git a/card/xuanzeti/index.html b/card/xuanzeti/index.html
index a6f8336..ac45050 100644
--- a/card/xuanzeti/index.html
+++ b/card/xuanzeti/index.html
@@ -38,7 +38,7 @@
-
+
diff --git a/categories/index.html b/categories/index.html
index f5abe14..6a52e00 100644
--- a/categories/index.html
+++ b/categories/index.html
@@ -38,7 +38,7 @@
-
+
diff --git a/css/coin.css b/css/coin.css
new file mode 100644
index 0000000..b2c6344
--- /dev/null
+++ b/css/coin.css
@@ -0,0 +1,75 @@
+/* 模态框样式 */
+.modal {
+ display: none;
+ position: fixed;
+ z-index: 1000;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ overflow: auto;
+ background-color: rgba(0,0,0,0.4);
+}
+
+.modal-content {
+ background-color: #fefefe;
+ margin: 15% auto;
+ padding: 20px;
+ border: 1px solid #888;
+ width: 80%;
+ max-width: 400px;
+ border-radius: 10px;
+ text-align: center;
+}
+
+/* 按钮样式 */
+.modal-content button {
+ margin: 10px 0;
+ padding: 10px 20px;
+ background-color: #007BFF;
+ border: none;
+ border-radius: 4px;
+ color: white;
+ cursor: pointer;
+}
+
+.modal-content button:hover {
+ background-color: #0056b3;
+}
+
+.modal-content button:active {
+ background-color: #003f7f;
+}
+
+/* 夜间模式 */
+.dark .modal-content {
+ background-color: #333;
+ color: #fff;
+}
+
+.dark .modal-content button {
+ background-color: #444;
+ color: #fff;
+}
+
+.dark .modal-content button:hover {
+ background-color: #555;
+}
+
+.dark .modal-content button:active {
+ background-color: #666;
+}
+
+.modal-content input {
+ width: calc(100% - 40px);
+ padding: 10px;
+ margin: 10px 0;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+}
+
+.dark .modal-content input {
+ background-color: #555;
+ color: #fff;
+ border: 1px solid #666;
+}
diff --git a/index.html b/index.html
index f4adfab..9d5008c 100644
--- a/index.html
+++ b/index.html
@@ -39,7 +39,7 @@
-
+
diff --git a/js/coin.js b/js/coin.js
new file mode 100644
index 0000000..a3efc8a
--- /dev/null
+++ b/js/coin.js
@@ -0,0 +1,242 @@
+// 封装的加载金币系统函数
+function loadCoinSystem() {
+ // 获取当前时间并转换为北京时间
+ function getCurrentTime() {
+ const now = new Date();
+ const beijingTime = new Date(now.getTime() + 8 * 60 * 60 * 1000); // 直接加8小时
+ return beijingTime.toISOString().replace('T', ' ').substring(0, 19); // 格式化时间
+ }
+
+ // 初始化金币系统
+ async function initializeCoinSystem() {
+ try {
+ // 检查 verify.json 文件是否存在且为 true
+ const verifyUrl = `https://download.xn--xhq44jb2fzpc.com/user/${curemail}/coin/verify.json`;
+ const response = await fetchNoCache(verifyUrl);
+ const verifyResponse = await response.json(); // 正确地处理响应体中的 JSON 数据
+
+ console.log("Verify Response: ", verifyResponse);
+
+ if (verifyResponse === true) {
+ // 读取 list.json 文件
+ const listUrl = `https://download.xn--xhq44jb2fzpc.com/user/${curemail}/coin/list.json`;
+ const coinDataResponse = await fetchNoCache(listUrl);
+ const coinData = await coinDataResponse.json(); // 处理 coinData JSON 数据
+ renderCoinContent(coinData);
+ } else {
+ throw new Error('Verification required');
+ }
+ } catch (error) {
+ console.error("Error in initializeCoinSystem: ", error);
+ renderVerificationPrompt();
+ }
+ }
+
+
+
+
+ // 渲染金币内容
+ function renderCoinContent(coinData) {
+ const coinContent = document.getElementById('coin-content');
+ coinContent.innerHTML = `
当前金币数:${coinData.coins}
`;
+
+ const table = document.createElement('table');
+ const headerRow = table.insertRow();
+ headerRow.innerHTML = `时间 | 明细 | 操作 | `;
+
+ coinData.transactions.forEach(transaction => {
+ const row = table.insertRow();
+ row.innerHTML = `
+ ${transaction.date} |
+ ${transaction.type === 'credit' ? '+' : '-'}${transaction.amount} |
+ ${transaction.description} |
+ `;
+ });
+
+ coinContent.appendChild(table);
+ }
+
+ // 渲染验证提示
+ function renderVerificationPrompt() {
+ const coinContent = document.getElementById('coin-content');
+ coinContent.innerHTML = `
+ 您需要进行手机验证以解锁金币系统。下载某些资源时会花费金币,而投稿审核通过后可以获得金币。
+ 请注意:由于下载同一份文件两次,从服务器流出的下行流量也会计算两次,因此当您多次下载同一个需要金币的资源时,金币也会多次扣除。我们建议您减少不必要的重复下载。
+
+ `;
+
+ // 按钮样式定义
+ const firstVerifyBtn = document.getElementById('first-verify-btn');
+ firstVerifyBtn.style.display = 'block';
+ firstVerifyBtn.style.margin = '0 auto';
+ firstVerifyBtn.style.padding = '10px 20px';
+ firstVerifyBtn.style.backgroundColor = '#007BFF';
+ firstVerifyBtn.style.color = '#fff';
+ firstVerifyBtn.style.border = 'none';
+ firstVerifyBtn.style.borderRadius = '4px';
+ firstVerifyBtn.style.cursor = 'pointer';
+ firstVerifyBtn.style.textAlign = 'center';
+
+ firstVerifyBtn.onmouseover = function () {
+ firstVerifyBtn.style.backgroundColor = '#0056b3';
+ };
+
+ firstVerifyBtn.onmouseout = function () {
+ firstVerifyBtn.style.backgroundColor = '#007BFF';
+ };
+
+ firstVerifyBtn.onmousedown = function () {
+ firstVerifyBtn.style.backgroundColor = '#003f7f';
+ };
+
+ // 夜间模式样式
+ if (document.body.classList.contains('dark')) {
+ firstVerifyBtn.style.backgroundColor = '#444';
+ firstVerifyBtn.style.color = '#fff';
+ }
+
+ // 点击验证按钮,弹出模态框
+ firstVerifyBtn.addEventListener('click', showVerificationModal);
+ }
+
+ // 显示验证模态框
+ function showVerificationModal() {
+ const modal = document.getElementById('verification-modal');
+ modal.style.display = 'block';
+
+ const sendCodeBtn = document.getElementById('send-code-btn');
+ const verifyBtn = document.getElementById('verify-btn');
+ const phoneNumberInput = document.getElementById('phone-number');
+ const verificationCodeInput = document.getElementById('verification-code');
+ const modalMessage = document.getElementById('modal-message');
+
+ sendCodeBtn.addEventListener('click', async () => {
+ const phoneNumber = phoneNumberInput.value.trim();
+ if (!/^\d{11}$/.test(phoneNumber) || phoneNumber.charAt(0) !== '1') {
+ modalMessage.innerText = '请输入有效的11位手机号码!';
+ return;
+ }
+
+ try {
+ // 检查手机号是否已验证
+ const phoneHash = CryptoJS.SHA256(phoneNumber).toString();
+ const phonesResponse = await fetchNoCache('https://download.xn--xhq44jb2fzpc.com/user/pn.json');
+ const phonesData = await phonesResponse.json();
+
+ if (phonesData.includes(phoneHash)) {
+ modalMessage.innerText = '此手机号已被验证过!';
+ sendCodeBtn.disabled = false;
+ sendCodeBtn.textContent = '发送验证码';
+ return;
+ }
+
+ // 禁用发送按钮并修改按钮文本
+ sendCodeBtn.disabled = true;
+ sendCodeBtn.textContent = '禁用中...';
+ setTimeout(() => {
+ sendCodeBtn.disabled = false;
+ sendCodeBtn.textContent = '发送验证码';
+ }, 120000); // 2分钟后重新启用发送按钮并恢复原始文本
+
+ const response = await fetch('https://sms.xn--xhq44jb2fzpc.com/send-code', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ phoneNumber })
+ });
+ const result = await response.json();
+ if (response.ok) {
+ modalMessage.innerText = '验证码已发送,请查收。2分钟后可重新发送。';
+ sessionStorage.setItem('phoneNumber', phoneNumber); // 保存手机号
+ } else {
+ modalMessage.innerText = `发送失败!请稍后再试。`;
+ sendCodeBtn.disabled = false; // 如果发送失败,立即恢复按钮可用状态
+ sendCodeBtn.textContent = '发送验证码'; // 恢复原始按钮文本
+ }
+ } catch (error) {
+ modalMessage.innerText = '发送验证码时出错,请稍后重试。';
+ sendCodeBtn.disabled = false; // 如果发送失败,立即恢复按钮可用状态
+ sendCodeBtn.textContent = '发送验证码'; // 恢复原始按钮文本
+ }
+ });
+
+
+ // 验证验证码事件
+ verifyBtn.addEventListener('click', async () => {
+ const phoneNumber = sessionStorage.getItem('phoneNumber'); // 从 sessionStorage 中获取手机号
+ const verificationCode = verificationCodeInput.value.trim();
+
+ // 每次开始验证前清空消息文本
+ modalMessage.innerText = '';
+
+ if (!verificationCode || !phoneNumber) {
+ modalMessage.innerText = '请输入手机号和验证码。';
+ return;
+ }
+
+ try {
+ const response = await fetch('https://sms.xn--xhq44jb2fzpc.com/verify-code', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ phoneNumber, verificationCode })
+ });
+ const result = await response.json();
+ if (response.ok && result.verified) {
+ modalMessage.innerText = '验证通过,请稍后……';
+
+ const phoneHash = CryptoJS.SHA256(phoneNumber).toString();
+ const phonesResponse = await fetchNoCache('https://download.xn--xhq44jb2fzpc.com/user/pn.json');
+ const phonesData = await phonesResponse.json();
+ phonesData.push(phoneHash);
+
+ await client.put('user/pn.json', new Blob([JSON.stringify(phonesData)], { type: 'application/json' }));
+
+ setTimeout(async () => {
+ modal.style.display = 'none';
+
+ // 初始化金币系统
+ const initialData = {
+ userEmail: curemail,
+ coins: 20,
+ transactions: [
+ {
+ type: 'credit',
+ amount: 20,
+ description: '初始金币奖励',
+ date: getCurrentTime()
+ }
+ ]
+ };
+ const userInfoBlob = new Blob([JSON.stringify(true)], { type: 'application/json' });
+ await client.put(`user/${curemail}/coin/verify.json`, userInfoBlob);
+
+ const coinBlob = new Blob([JSON.stringify(initialData)], { type: 'application/json' });
+ await client.put(`user/${curemail}/coin/list.json`, coinBlob);
+
+ // 重新读取并渲染金币信息
+ renderCoinContent(initialData);
+ }, 2000);
+ } else {
+ modalMessage.innerText = '验证码错误,请重新输入。';
+ }
+ } catch (error) {
+ modalMessage.innerText = '验证时出错,请稍后重试。';
+ }
+ });
+
+
+ }
+
+
+
+ document.getElementById('cancel-btn').addEventListener('click', function() {
+ // 获取模态框元素
+ const modal = document.getElementById('verification-modal');
+
+ // 隐藏模态框
+ modal.style.display = 'none';
+ });
+
+ // 初始化系统
+ initializeCoinSystem();
+}
+
diff --git a/js/coin.min.js b/js/coin.min.js
new file mode 100644
index 0000000..beeb8b2
--- /dev/null
+++ b/js/coin.min.js
@@ -0,0 +1,9 @@
+function loadCoinSystem(){function d(e){var t=document.getElementById("coin-content");t.innerHTML=`当前金币数:${e.coins}
`;let n=document.createElement("table");n.insertRow().innerHTML="时间 | 明细 | 操作 | ",e.transactions.forEach(e=>{n.insertRow().innerHTML=`
+ ${e.date} |
+ ${"credit"===e.type?"+":"-"}${e.amount} |
+ ${e.description} |
+ `}),t.appendChild(n)}function o(){let s=document.getElementById("verification-modal"),o=(s.style.display="block",document.getElementById("send-code-btn"));var e=document.getElementById("verify-btn");let i=document.getElementById("phone-number"),a=document.getElementById("verification-code"),c=document.getElementById("modal-message");o.addEventListener("click",async()=>{var e=i.value.trim();if(/^\d{11}$/.test(e)&&"1"===e.charAt(0))try{var t,n=CryptoJS.SHA256(e).toString();(await(await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/user/pn.json")).json()).includes(n)?(c.innerText="此手机号已被验证过!",o.disabled=!1,o.textContent="发送验证码"):(o.disabled=!0,o.textContent="禁用中...",setTimeout(()=>{o.disabled=!1,o.textContent="发送验证码"},12e4),await(t=await fetch("https://sms.xn--xhq44jb2fzpc.com/send-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phoneNumber:e})})).json(),t.ok?(c.innerText="验证码已发送,请查收。2分钟后可重新发送。",sessionStorage.setItem("phoneNumber",e)):(c.innerText="发送失败!请稍后再试。",o.disabled=!1,o.textContent="发送验证码"))}catch(e){c.innerText="发送验证码时出错,请稍后重试。",o.disabled=!1,o.textContent="发送验证码"}else c.innerText="请输入有效的11位手机号码!"}),e.addEventListener("click",async()=>{var e=sessionStorage.getItem("phoneNumber"),t=a.value.trim();if(c.innerText="",t&&e)try{var n,o,i=await fetch("https://sms.xn--xhq44jb2fzpc.com/verify-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phoneNumber:e,verificationCode:t})}),r=await i.json();i.ok&&r.verified?(c.innerText="验证通过,请稍后……",n=CryptoJS.SHA256(e).toString(),(o=await(await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/user/pn.json")).json()).push(n),await client.put("user/pn.json",new Blob([JSON.stringify(o)],{type:"application/json"})),setTimeout(async()=>{s.style.display="none";var e={userEmail:curemail,coins:20,transactions:[{type:"credit",amount:20,description:"初始金币奖励",date:(e=new Date,new Date(e.getTime()+288e5).toISOString().replace("T"," ").substring(0,19))}]},t=new Blob([JSON.stringify(!0)],{type:"application/json"}),t=(await client.put(`user/${curemail}/coin/verify.json`,t),new Blob([JSON.stringify(e)],{type:"application/json"}));await client.put(`user/${curemail}/coin/list.json`,t),d(e)},2e3)):c.innerText="验证码错误,请重新输入。"}catch(e){c.innerText="验证时出错,请稍后重试。"}else c.innerText="请输入手机号和验证码。"})}document.getElementById("cancel-btn").addEventListener("click",function(){document.getElementById("verification-modal").style.display="none"}),async function(){try{var e=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/coin/verify.json`,t=await(await fetchNoCache(e)).json();if(console.log("Verify Response: ",t),!0!==t)throw new Error("Verification required");var n=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/coin/list.json`;d(await(await fetchNoCache(n)).json())}catch(e){console.error("Error in initializeCoinSystem: ",e);{let e=document.getElementById("coin-content"),t=(e.innerHTML=`
+ 您需要进行手机验证以解锁金币系统。下载某些资源时会花费金币,而投稿审核通过后可以获得金币。
+ 请注意:由于下载同一份文件两次,从服务器流出的下行流量也会计算两次,因此当您多次下载同一个需要金币的资源时,金币也会多次扣除。我们建议您减少不必要的重复下载。
+
+ `,document.getElementById("first-verify-btn"));t.style.display="block",t.style.margin="0 auto",t.style.padding="10px 20px",t.style.backgroundColor="#007BFF",t.style.color="#fff",t.style.border="none",t.style.borderRadius="4px",t.style.cursor="pointer",t.style.textAlign="center",t.onmouseover=function(){t.style.backgroundColor="#0056b3"},t.onmouseout=function(){t.style.backgroundColor="#007BFF"},t.onmousedown=function(){t.style.backgroundColor="#003f7f"},document.body.classList.contains("dark")&&(t.style.backgroundColor="#444",t.style.color="#fff");t.addEventListener("click",o);return}}}()}
\ No newline at end of file
diff --git a/js/dl - 副本.js b/js/dl - 副本.js
new file mode 100644
index 0000000..7cf9b05
--- /dev/null
+++ b/js/dl - 副本.js
@@ -0,0 +1,93 @@
+let client;
+
+async function fetchNoCache(url) {
+ const timestamp = new Date().getTime();
+ const noCacheUrl = `${url}?timestamp=${timestamp}`;
+ return fetch(noCacheUrl);
+}
+
+async function f1() {
+ try {
+ const r1 = await fetchNoCache('https://download.xn--xhq44jb2fzpc.com/download/json/s.json');
+ const d1 = await r1.json();
+
+ const m1 = d1.masterKey;
+ const k1 = CryptoJS.SHA256(m1);
+
+ const c1 = {
+ region: d2(d1.encryptedRegion, k1),
+ accessKeyId: d2(d1.encryptedKeyId, k1),
+ accessKeySecret: d2(d1.encryptedKeySecret, k1),
+ bucket: d2(d1.encryptedBucket, k1)
+ };
+
+ client = new OSS(c1);
+ // console.log("OSS Client Initialized Successfully with decrypted config", client);
+ } catch (e1) {
+ console.error('Failed to fetch or decrypt OSS config:', e1);
+ }
+}
+
+function d2(e2, k2) {
+ e2 = e2.replace(/\s/g, '');
+ const e3 = CryptoJS.enc.Base64.parse(e2);
+ const iv = CryptoJS.lib.WordArray.create(e3.words.slice(0, 4));
+ const e4 = CryptoJS.lib.WordArray.create(e3.words.slice(4));
+
+ const d3 = CryptoJS.AES.decrypt({ ciphertext: e4 }, k2, {
+ iv: iv,
+ mode: CryptoJS.mode.CBC,
+ padding: CryptoJS.pad.Pkcs7
+ });
+ return d3.toString(CryptoJS.enc.Utf8);
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ const initializeDownloadLink = (linkId, popupId, key) => {
+ const downloadLink = document.getElementById(linkId);
+ const popup = document.getElementById(popupId);
+ const popupContent = popup.querySelector('.popup-content');
+
+ downloadLink.addEventListener('click', function() {
+ let countdown = 3;
+
+ f1().then(() => {
+ if (client) {
+ // 在这里生成签名URL
+ let actualLink = client.signatureUrl(key, {
+ expires: 20, // 过期时间为 20 秒
+ response: {
+ 'content-disposition': 'attachment' // 强制下载
+ }
+ });
+
+ // 替换域名部分
+ const sanitizedUrl = actualLink.replace('emberimg.oss-cn-beijing.aliyuncs.com', 'download.xn--xhq44jb2fzpc.com');
+
+ const updatePopup = () => {
+ if (countdown > 0) {
+ popupContent.textContent = `${countdown}秒后将开始下载...`;
+ countdown--;
+ setTimeout(updatePopup, 1000);
+ } else {
+ popup.style.display = 'none';
+ window.location.href = sanitizedUrl;
+ }
+ };
+
+ popup.style.display = 'block';
+ updatePopup();
+
+ } else {
+ console.error('Failed to initialize OSS client due to decryption error.');
+ }
+ }).catch(e2 => {
+ console.log('Error initializing OSS Client:', e2);
+ });
+ });
+ };
+
+ window.initializeDownloadLink = initializeDownloadLink;
+});
+
+
diff --git a/js/dl.js b/js/dl.js
index 637aba1..7cf9b05 100644
--- a/js/dl.js
+++ b/js/dl.js
@@ -1,5 +1,49 @@
+let client;
+
+async function fetchNoCache(url) {
+ const timestamp = new Date().getTime();
+ const noCacheUrl = `${url}?timestamp=${timestamp}`;
+ return fetch(noCacheUrl);
+}
+
+async function f1() {
+ try {
+ const r1 = await fetchNoCache('https://download.xn--xhq44jb2fzpc.com/download/json/s.json');
+ const d1 = await r1.json();
+
+ const m1 = d1.masterKey;
+ const k1 = CryptoJS.SHA256(m1);
+
+ const c1 = {
+ region: d2(d1.encryptedRegion, k1),
+ accessKeyId: d2(d1.encryptedKeyId, k1),
+ accessKeySecret: d2(d1.encryptedKeySecret, k1),
+ bucket: d2(d1.encryptedBucket, k1)
+ };
+
+ client = new OSS(c1);
+ // console.log("OSS Client Initialized Successfully with decrypted config", client);
+ } catch (e1) {
+ console.error('Failed to fetch or decrypt OSS config:', e1);
+ }
+}
+
+function d2(e2, k2) {
+ e2 = e2.replace(/\s/g, '');
+ const e3 = CryptoJS.enc.Base64.parse(e2);
+ const iv = CryptoJS.lib.WordArray.create(e3.words.slice(0, 4));
+ const e4 = CryptoJS.lib.WordArray.create(e3.words.slice(4));
+
+ const d3 = CryptoJS.AES.decrypt({ ciphertext: e4 }, k2, {
+ iv: iv,
+ mode: CryptoJS.mode.CBC,
+ padding: CryptoJS.pad.Pkcs7
+ });
+ return d3.toString(CryptoJS.enc.Utf8);
+}
+
document.addEventListener('DOMContentLoaded', function() {
- const initializeDownloadLink = (linkId, popupId, actualLink) => {
+ const initializeDownloadLink = (linkId, popupId, key) => {
const downloadLink = document.getElementById(linkId);
const popup = document.getElementById(popupId);
const popupContent = popup.querySelector('.popup-content');
@@ -7,21 +51,43 @@ document.addEventListener('DOMContentLoaded', function() {
downloadLink.addEventListener('click', function() {
let countdown = 3;
- const updatePopup = () => {
- if (countdown > 0) {
- popupContent.textContent = `${countdown}秒后将开始下载...`;
- countdown--;
- setTimeout(updatePopup, 1000);
- } else {
- popup.style.display = 'none';
- window.location.href = actualLink;
- }
- };
+ f1().then(() => {
+ if (client) {
+ // 在这里生成签名URL
+ let actualLink = client.signatureUrl(key, {
+ expires: 20, // 过期时间为 20 秒
+ response: {
+ 'content-disposition': 'attachment' // 强制下载
+ }
+ });
- popup.style.display = 'block';
- updatePopup();
+ // 替换域名部分
+ const sanitizedUrl = actualLink.replace('emberimg.oss-cn-beijing.aliyuncs.com', 'download.xn--xhq44jb2fzpc.com');
+
+ const updatePopup = () => {
+ if (countdown > 0) {
+ popupContent.textContent = `${countdown}秒后将开始下载...`;
+ countdown--;
+ setTimeout(updatePopup, 1000);
+ } else {
+ popup.style.display = 'none';
+ window.location.href = sanitizedUrl;
+ }
+ };
+
+ popup.style.display = 'block';
+ updatePopup();
+
+ } else {
+ console.error('Failed to initialize OSS client due to decryption error.');
+ }
+ }).catch(e2 => {
+ console.log('Error initializing OSS Client:', e2);
+ });
});
};
window.initializeDownloadLink = initializeDownloadLink;
});
+
+
diff --git a/js/dl.min.js b/js/dl.min.js
new file mode 100644
index 0000000..ff91d08
--- /dev/null
+++ b/js/dl.min.js
@@ -0,0 +1 @@
+let client;async function fetchNoCache(e){var t=(new Date).getTime();return fetch(e+"?timestamp="+t)}async function f1(){try{var e=await(await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/download/json/s.json")).json(),t=e.masterKey,n=CryptoJS.SHA256(t),o={region:d2(e.encryptedRegion,n),accessKeyId:d2(e.encryptedKeyId,n),accessKeySecret:d2(e.encryptedKeySecret,n),bucket:d2(e.encryptedBucket,n)};client=new OSS(o)}catch(e){console.error("Failed to fetch or decrypt OSS config:",e)}}function d2(e,t){e=e.replace(/\s/g,"");var e=CryptoJS.enc.Base64.parse(e),n=CryptoJS.lib.WordArray.create(e.words.slice(0,4)),e=CryptoJS.lib.WordArray.create(e.words.slice(4));return CryptoJS.AES.decrypt({ciphertext:e},t,{iv:n,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)}document.addEventListener("DOMContentLoaded",function(){window.initializeDownloadLink=(e,t,o)=>{e=document.getElementById(e);let c=document.getElementById(t),r=c.querySelector(".popup-content");e.addEventListener("click",function(){let n=3;f1().then(()=>{if(client){let e=client.signatureUrl(o,{expires:20,response:{"content-disposition":"attachment"}}).replace("emberimg.oss-cn-beijing.aliyuncs.com","download.xn--xhq44jb2fzpc.com"),t=()=>{0{console.log("Error initializing OSS Client:",e)})})}});
\ No newline at end of file
diff --git a/js/dlwithcoin.js b/js/dlwithcoin.js
new file mode 100644
index 0000000..8a6edb5
--- /dev/null
+++ b/js/dlwithcoin.js
@@ -0,0 +1,159 @@
+
+let client;
+
+function getCookie(name) {
+ const nameEQ = name + "=";
+ const ca = document.cookie.split(';');
+ for(let i = 0; i < ca.length; i++) {
+ let c = ca[i];
+ while (c.charAt(0) == ' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+}
+
+async function fetchNoCache(url) {
+ const timestamp = new Date().getTime();
+ const noCacheUrl = `${url}?timestamp=${timestamp}`;
+ return fetch(noCacheUrl);
+}
+
+async function f1() {
+ try {
+ const r1 = await fetchNoCache('https://download.xn--xhq44jb2fzpc.com/upload/json/s.json');
+ const d1 = await r1.json();
+
+ const m1 = d1.masterKey;
+ const k1 = CryptoJS.SHA256(m1);
+
+ const c1 = {
+ region: d2(d1.encryptedRegion, k1),
+ accessKeyId: d2(d1.encryptedKeyId, k1),
+ accessKeySecret: d2(d1.encryptedKeySecret, k1),
+ bucket: d2(d1.encryptedBucket, k1)
+ };
+
+ client = new OSS(c1);
+ // console.log("OSS Client Initialized Successfully with decrypted config", client);
+ } catch (e1) {
+ console.error('Failed to fetch or decrypt OSS config:', e1);
+ }
+}
+
+function d2(e2, k2) {
+ e2 = e2.replace(/\s/g, '');
+ const e3 = CryptoJS.enc.Base64.parse(e2);
+ const iv = CryptoJS.lib.WordArray.create(e3.words.slice(0, 4));
+ const e4 = CryptoJS.lib.WordArray.create(e3.words.slice(4));
+
+ const d3 = CryptoJS.AES.decrypt({ ciphertext: e4 }, k2, {
+ iv: iv,
+ mode: CryptoJS.mode.CBC,
+ padding: CryptoJS.pad.Pkcs7
+ });
+ return d3.toString(CryptoJS.enc.Utf8);
+}
+
+// 初始化client
+f1();
+
+document.addEventListener("DOMContentLoaded", function() {
+ const linkId = "{{ .Get "id" }}";
+ const objectKey = "{{ .Get "url" }}"; // 使用URL参数作为OSS对象的key
+ const popupId = "popup-" + linkId;
+ const requiredCoins = {{ .Get "coin" | default 0 }}; // 获取需要扣除的金币数,默认为0
+
+ const checkAndDownload = async () => {
+ const loggedIn = getCookie('loggedIn');
+ const email = getCookie('userEmail');
+
+ if (!loggedIn) {
+ alert("请登录后下载!");
+ window.location.href = "/submission";
+ return;
+ }
+
+ if (requiredCoins > 0) {
+ const coinListUrl = `https://download.xn--xhq44jb2fzpc.com/user/${email}/coin/list.json`;
+ try {
+ const response = await fetchNoCache(coinListUrl);
+ if (!response.ok) {
+ alert("您还未激活金币系统,请前往激活!");
+ window.location.href = "/submission";
+ return;
+ }
+ const data = await response.json();
+ if (data.coins < requiredCoins) {
+ alert(`您的金币数量不够!当前资源要求金币数:${requiredCoins};您的金币数:${data.coins}。`);
+ return;
+ } else {
+ if (confirm(`当前下载操作花费:${requiredCoins}金币;您的金币:${data.coins}。是否继续?`)) {
+ data.coins -= requiredCoins;
+ data.transactions.push({
+ type: "debit",
+ amount: requiredCoins,
+ description: "下载资源",
+ date: getCurrentTime()
+ });
+ const coinBlob = new Blob([JSON.stringify(data)], { type: 'application/json' });
+ await client.put(`user/${email}/coin/list.json`, coinBlob);
+
+ // 调用下载功能并进行倒计时
+ startDownload(linkId, popupId, objectKey);
+ }
+ }
+ } catch (error) {
+ console.error("Error handling coins for download:", error);
+ alert("无法处理您的请求,请稍后重试。");
+ }
+ } else {
+ // 如果不需要金币,直接开始下载
+ startDownload(linkId, popupId, objectKey);
+ }
+ };
+
+ const startDownload = (linkId, popupId, key) => {
+ let countdown = 3;
+ const popup = document.getElementById(popupId);
+ const popupContent = popup.querySelector('.popup-content');
+
+ if (client) {
+ let actualLink = client.signatureUrl(key, {
+ expires: 20, // 过期时间为 20 秒
+ response: {
+ 'content-disposition': 'attachment' // 强制下载
+ }
+ });
+
+ // 替换域名部分
+ const sanitizedUrl = actualLink.replace('emberimg.oss-cn-beijing.aliyuncs.com', 'download.xn--xhq44jb2fzpc.com');
+
+ const updatePopup = () => {
+ if (countdown > 0) {
+ popupContent.textContent = `${countdown}秒后将开始下载...`;
+ countdown--;
+ setTimeout(updatePopup, 1000);
+ } else {
+ popup.style.display = 'none';
+ window.location.href = sanitizedUrl;
+ }
+ };
+
+ popup.style.display = 'block';
+ updatePopup();
+
+ } else {
+ console.error('OSS client is not initialized.');
+ }
+ };
+
+ document.getElementById(linkId).addEventListener('click', checkAndDownload);
+});
+
+
+
+function getCurrentTime() {
+ const now = new Date();
+ const beijingTime = new Date(now.getTime() + 8 * 60 * 60 * 1000); // 直接加8小时
+ return beijingTime.toISOString().replace('T', ' ').substring(0, 19); // 格式化时间
+}
\ No newline at end of file
diff --git a/js/dlwithcoin.min.js b/js/dlwithcoin.min.js
new file mode 100644
index 0000000..dd1d657
--- /dev/null
+++ b/js/dlwithcoin.min.js
@@ -0,0 +1 @@
+let client;function getCookie(t){const n=t+"=";const o=document.cookie.split(";");for(let e=0;e{const t=getCookie("loggedIn");const e=getCookie("userEmail");if(!t){alert("请登录后下载!");window.location.href="/submission";return}if(l>0){const n=`https://download.xn--xhq44jb2fzpc.com/user/${e}/coin/list.json`;try{const o=await fetchNoCache(n);if(!o.ok){alert("您还未激活金币系统,请前往激活!");window.location.href="/submission";return}const c=await o.json();if(c.coins{let o=3;const c=document.getElementById(e);const s=c.querySelector(".popup-content");if(client){let t=client.signatureUrl(n,{expires:20,response:{"content-disposition":"attachment"}});const i=t.replace("emberimg.oss-cn-beijing.aliyuncs.com","download.xn--xhq44jb2fzpc.com");const r=()=>{if(o>0){s.textContent=`${o}秒后将开始下载...`;o--;setTimeout(r,1e3)}else{c.style.display="none";window.location.href=i}};c.style.display="block";r()}else{console.error("OSS client is not initialized.")}};document.getElementById(i).addEventListener("click",t)});function getCurrentTime(){const t=new Date;const e=new Date(t.getTime()+8*60*60*1e3);return e.toISOString().replace("T"," ").substring(0,19)}
\ No newline at end of file
diff --git a/js/submission.js b/js/submission.js
index a28e5cd..b2a7511 100644
--- a/js/submission.js
+++ b/js/submission.js
@@ -254,19 +254,26 @@ function showSubmission() {
document.getElementById('submission-area').style.display = 'block';
document.getElementById('myinfo').style.display = 'none';
document.getElementById('mysubmission').style.display = 'none';
+ document.getElementById('mycoin').style.display = 'none';
+
}
function showMyInfo() {
document.getElementById('submission-area').style.display = 'none';
document.getElementById('myinfo').style.display = 'block';
document.getElementById('mysubmission').style.display = 'none';
+ document.getElementById('mycoin').style.display = 'none';
+
}
-function showMySubmissions() {
+function showMyContent() {
document.getElementById('submission-area').style.display = 'none';
document.getElementById('myinfo').style.display = 'none';
fetchSubmissionData(curemail, submitted);
document.getElementById('mysubmission').style.display = 'block';
+ document.getElementById('mycoin').style.display = 'block';
+ loadCoinSystem();
+
}
async function updateUserInfo() {
diff --git a/js/submission.min.js b/js/submission.min.js
index 9a378d1..a227620 100644
--- a/js/submission.min.js
+++ b/js/submission.min.js
@@ -1,16 +1,16 @@
-let client,s=!1;var curemail="",submitted=0;function getCookie(e){var n=e+"=",o=document.cookie.split(";");for(let t=0;t{window.location.href="/qualification_verify"}),document.getElementById("logoutButton").addEventListener("click",()=>{logout()})}async function f1(){try{var e=await(await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/json/s.json")).json(),t=e.masterKey,n=CryptoJS.SHA256(t),o={region:d2(e.encryptedRegion,n),accessKeyId:d2(e.encryptedKeyId,n),accessKeySecret:d2(e.encryptedKeySecret,n),bucket:d2(e.encryptedBucket,n)};client=new OSS(o)}catch(e){console.error("Failed to fetch or decrypt OSS config:",e)}}function d2(e,t){e=e.replace(/\s/g,"");var e=CryptoJS.enc.Base64.parse(e),n=CryptoJS.lib.WordArray.create(e.words.slice(0,4)),e=CryptoJS.lib.WordArray.create(e.words.slice(4));return CryptoJS.AES.decrypt({ciphertext:e},t,{iv:n,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)}document.addEventListener("DOMContentLoaded",function(){f1().then(()=>{client||console.error("Failed to initialize OSS client due to decryption error.")}).catch(e=>{console.log("Error initializing OSS Client:",e)})});let buttons=document.querySelectorAll(".navButton");function showSubmission(){document.getElementById("submission-area").style.display="block",document.getElementById("myinfo").style.display="none",document.getElementById("mysubmission").style.display="none"}function showMyInfo(){document.getElementById("submission-area").style.display="none",document.getElementById("myinfo").style.display="block",document.getElementById("mysubmission").style.display="none"}function showMySubmissions(){document.getElementById("submission-area").style.display="none",document.getElementById("myinfo").style.display="none",fetchSubmissionData(curemail,submitted),document.getElementById("mysubmission").style.display="block"}async function updateUserInfo(){if(s){var e=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`;try{var t=await fetchNoCache(e);if(!t.ok)throw new Error("p.json not found");var n=await t.json();n&&n.nickname?(document.getElementById("nickname").innerText=n.nickname,console.log("Nickname has been successfully updated.")):(document.getElementById("nickname").innerText="Default Nickname",console.log("Default nickname set due to missing 'nickname' field in response."))}catch(e){console.error("Error loading p.json:",e),document.getElementById("nickname").innerText="Default Nickname"}}else console.log("User is not logged in.")}async function checkAndLoadAvatar(){if(s){var e=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`,t=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/avatar`,n="https://download.xn--xhq44jb2fzpc.com/avatar/default.png";try{var o,i=await fetchNoCache(e);if(!i.ok)throw new Error("p.json not found");(await i.json()).hasAvatar?(o=t+"?t="+Date.now(),document.getElementById("myinfoavatar").src=o,console.log("Custom avatar loaded.")):(document.getElementById("myinfoavatar").src=n,console.log("Default avatar loaded due to `hasAvatar` being false."))}catch(e){document.getElementById("myinfoavatar").src=n,console.error("Error loading p.json. Using default avatar:",e)}}else console.log("User is not logged in.")}function showTooltip(e,t,n){var o=document.getElementById("tooltip"),i=document.getElementById("tooltip-title"),a=document.getElementById("tooltip-content");i.textContent=t,a.textContent=n,o.classList.add("show")}function hideTooltip(){document.getElementById("tooltip").classList.remove("show")}async function checkVerifiedStatus(t){if(t){let e=document.getElementById("verified-icon");try{var n=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/verified-email/verified-email.json");if(!n.ok)throw new Error("Failed to fetch verified-email.json");(await n.json()).includes(t)?(e.style.display="inline-flex",console.log("Email is verified."),e.addEventListener("mouseenter",()=>fetchVerificationDetails(t,e)),e.addEventListener("mouseleave",hideTooltip),e.addEventListener("click",()=>fetchVerificationDetails(t,e))):console.log("Email is not verified.")}catch(e){console.error("Error loading or parsing verified-email.json:",e)}}else console.log("Email not provided, skipping verified status check.")}async function fetchVerificationDetails(e,t){e=`https://download.xn--xhq44jb2fzpc.com/user/${e}/verified.json`;try{var n=await fetchNoCache(e);n.ok?showTooltip(t,"认证作者",(await n.json()).description):404===n.status&&showTooltip(t,"认证作者","本作者为经过网站认证的优质内容分享者。")}catch(e){console.error("Error fetching verification details:",e),showTooltip(t,"认证作者","本作者为经过网站认证的优质内容分享者。")}}async function checkInvitedStatus(t){if(t){let e=document.getElementById("invited-icon");try{var n=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/invited-email/invited-email.json");if(!n.ok)throw new Error("Failed to fetch invited-email.json");(await n.json()).includes(t)?(e.style.display="inline-flex",console.log("Email is an invited author."),e.addEventListener("mouseenter",()=>fetchInvitedInfo(t,e)),e.addEventListener("mouseleave",hideTooltip),e.addEventListener("click",()=>fetchInvitedInfo(t,e))):console.log("Email is not an invited author.")}catch(e){console.error("Error loading or parsing invited-email.json:",e)}}else console.log("Email not provided, skipping invited author status check.")}async function fetchInvitedInfo(e,t){e=`https://download.xn--xhq44jb2fzpc.com/user/${e}/invited.json`;try{var n=await fetchNoCache(e);n.ok?showTooltip(t,"特邀作者",(await n.json()).description||"无详细信息"):showTooltip(t,"特邀作者","无法获取信息")}catch(e){console.error("Error fetching invited info:",e),showTooltip(t,"特邀作者","无法加载信息")}}async function editNickname(){if(s){let e=prompt("请输入新的昵称:");if(null!==e)if(""===e.trim())alert("昵称不能为空!");else{var t=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`;try{var n=await fetchNoCache(t);if(!n.ok)throw new Error("Failed to fetch p.json");var o=await n.json(),i=(o.nickname=e,new Blob([JSON.stringify(o)],{type:"application/json"}));await client.put(`user/${curemail}/p.json`,i),console.log("p.json has been successfully updated with new nickname."),setTimeout(()=>{document.getElementById("nickname").innerText=e,console.log("Nickname has been updated on the page.")},1e3)}catch(e){console.error("Error updating nickname:",e)}}}else alert("您尚未登录,请登录后再尝试修改昵称。")}async function uploadAvatar(t){t=t.target.files[0];if(t&&t.size<=1048576)if(!0===s){var n=`user/${curemail}/p.json`,o=`user/${curemail}/avatar`;try{var i,a=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/"+n);let e;e=a.ok?await a.json():{h:[hashedPassword],nickname:"默认昵称",hasAvatar:!1},await client.put(o,t),console.log("Avatar has been successfully uploaded."),e.hasAvatar?setTimeout(()=>{document.getElementById("myinfoavatar").src+="?"+(new Date).getTime(),console.log("Forced reload of the existing avatar.")},2e3):(e.hasAvatar=!0,i=new Blob([JSON.stringify(e)],{type:"application/json"}),await client.put(n,i),console.log("p.json has been successfully uploaded."),setTimeout(()=>{document.getElementById("myinfoavatar").src="https://download.xn--xhq44jb2fzpc.com/"+o,console.log("myinfoavatar's src has been updated to the new avatar.")},2e3))}catch(e){console.error("Failed to upload new avatar or update p.json:",e)}}else alert("You are not logged in, please log in before attempting to upload an avatar.");else alert("头像必须小于 1MB!")}buttons.forEach(e=>{e.addEventListener("click",function(){buttons.forEach(e=>e.classList.remove("selected")),this.classList.add("selected")})}),document.body.addEventListener("click",e=>{var t=document.getElementById("tooltip"),n=document.getElementById("verified-icon"),o=document.getElementById("invited-icon");n.contains(e.target)||o.contains(e.target)||t.contains(e.target)||hideTooltip()}),document.getElementById("editNicknameBtn").addEventListener("click",editNickname),document.querySelector(".overlay").addEventListener("click",function(){document.getElementById("fileInput").click()});let input=document.getElementById("input");async function fetchSubmittedCount(e){e=`https://download.xn--xhq44jb2fzpc.com/upload/${e}/submitted.json`;try{var t=await fetchNoCache(e);if(!t.ok)throw new Error("File not found or access error");var n=await t.json();submitted=n,console.log("Submitted count updated:",submitted)}catch(e){submitted=0,console.log("Error fetching submitted count:",e)}}async function fetchSubmissionData(t,n){let o=`
+let client,s=!1;var curemail="",submitted=0;function getCookie(e){var n=e+"=",o=document.cookie.split(";");for(let t=0;t{window.location.href="/qualification_verify"}),document.getElementById("logoutButton").addEventListener("click",()=>{logout()})}async function f1(){try{var e=await(await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/json/s.json")).json(),t=e.masterKey,n=CryptoJS.SHA256(t),o={region:d2(e.encryptedRegion,n),accessKeyId:d2(e.encryptedKeyId,n),accessKeySecret:d2(e.encryptedKeySecret,n),bucket:d2(e.encryptedBucket,n)};client=new OSS(o)}catch(e){console.error("Failed to fetch or decrypt OSS config:",e)}}function d2(e,t){e=e.replace(/\s/g,"");var e=CryptoJS.enc.Base64.parse(e),n=CryptoJS.lib.WordArray.create(e.words.slice(0,4)),e=CryptoJS.lib.WordArray.create(e.words.slice(4));return CryptoJS.AES.decrypt({ciphertext:e},t,{iv:n,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)}document.addEventListener("DOMContentLoaded",function(){f1().then(()=>{client||console.error("Failed to initialize OSS client due to decryption error.")}).catch(e=>{console.log("Error initializing OSS Client:",e)})});let buttons=document.querySelectorAll(".navButton");function showSubmission(){document.getElementById("submission-area").style.display="block",document.getElementById("myinfo").style.display="none",document.getElementById("mysubmission").style.display="none",document.getElementById("mycoin").style.display="none"}function showMyInfo(){document.getElementById("submission-area").style.display="none",document.getElementById("myinfo").style.display="block",document.getElementById("mysubmission").style.display="none",document.getElementById("mycoin").style.display="none"}function showMyContent(){document.getElementById("submission-area").style.display="none",document.getElementById("myinfo").style.display="none",fetchSubmissionData(curemail,submitted),document.getElementById("mysubmission").style.display="block",document.getElementById("mycoin").style.display="block",loadCoinSystem()}async function updateUserInfo(){if(s){var e=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`;try{var t=await fetchNoCache(e);if(!t.ok)throw new Error("p.json not found");var n=await t.json();n&&n.nickname?(document.getElementById("nickname").innerText=n.nickname,console.log("Nickname has been successfully updated.")):(document.getElementById("nickname").innerText="Default Nickname",console.log("Default nickname set due to missing 'nickname' field in response."))}catch(e){console.error("Error loading p.json:",e),document.getElementById("nickname").innerText="Default Nickname"}}else console.log("User is not logged in.")}async function checkAndLoadAvatar(){if(s){var e=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`,t=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/avatar`,n="https://download.xn--xhq44jb2fzpc.com/avatar/default.png";try{var o,i=await fetchNoCache(e);if(!i.ok)throw new Error("p.json not found");(await i.json()).hasAvatar?(o=t+"?t="+Date.now(),document.getElementById("myinfoavatar").src=o,console.log("Custom avatar loaded.")):(document.getElementById("myinfoavatar").src=n,console.log("Default avatar loaded due to `hasAvatar` being false."))}catch(e){document.getElementById("myinfoavatar").src=n,console.error("Error loading p.json. Using default avatar:",e)}}else console.log("User is not logged in.")}function showTooltip(e,t,n){var o=document.getElementById("tooltip"),i=document.getElementById("tooltip-title"),a=document.getElementById("tooltip-content");i.textContent=t,a.textContent=n,o.classList.add("show")}function hideTooltip(){document.getElementById("tooltip").classList.remove("show")}async function checkVerifiedStatus(t){if(t){let e=document.getElementById("verified-icon");try{var n=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/verified-email/verified-email.json");if(!n.ok)throw new Error("Failed to fetch verified-email.json");(await n.json()).includes(t)?(e.style.display="inline-flex",console.log("Email is verified."),e.addEventListener("mouseenter",()=>fetchVerificationDetails(t,e)),e.addEventListener("mouseleave",hideTooltip),e.addEventListener("click",()=>fetchVerificationDetails(t,e))):console.log("Email is not verified.")}catch(e){console.error("Error loading or parsing verified-email.json:",e)}}else console.log("Email not provided, skipping verified status check.")}async function fetchVerificationDetails(e,t){e=`https://download.xn--xhq44jb2fzpc.com/user/${e}/verified.json`;try{var n=await fetchNoCache(e);n.ok?showTooltip(t,"认证作者",(await n.json()).description):404===n.status&&showTooltip(t,"认证作者","本作者为经过网站认证的优质内容分享者。")}catch(e){console.error("Error fetching verification details:",e),showTooltip(t,"认证作者","本作者为经过网站认证的优质内容分享者。")}}async function checkInvitedStatus(t){if(t){let e=document.getElementById("invited-icon");try{var n=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/invited-email/invited-email.json");if(!n.ok)throw new Error("Failed to fetch invited-email.json");(await n.json()).includes(t)?(e.style.display="inline-flex",console.log("Email is an invited author."),e.addEventListener("mouseenter",()=>fetchInvitedInfo(t,e)),e.addEventListener("mouseleave",hideTooltip),e.addEventListener("click",()=>fetchInvitedInfo(t,e))):console.log("Email is not an invited author.")}catch(e){console.error("Error loading or parsing invited-email.json:",e)}}else console.log("Email not provided, skipping invited author status check.")}async function fetchInvitedInfo(e,t){e=`https://download.xn--xhq44jb2fzpc.com/user/${e}/invited.json`;try{var n=await fetchNoCache(e);n.ok?showTooltip(t,"特邀作者",(await n.json()).description||"无详细信息"):showTooltip(t,"特邀作者","无法获取信息")}catch(e){console.error("Error fetching invited info:",e),showTooltip(t,"特邀作者","无法加载信息")}}async function editNickname(){if(s){let e=prompt("请输入新的昵称:");if(null!==e)if(""===e.trim())alert("昵称不能为空!");else{var t=`https://download.xn--xhq44jb2fzpc.com/user/${curemail}/p.json`;try{var n=await fetchNoCache(t);if(!n.ok)throw new Error("Failed to fetch p.json");var o=await n.json(),i=(o.nickname=e,new Blob([JSON.stringify(o)],{type:"application/json"}));await client.put(`user/${curemail}/p.json`,i),console.log("p.json has been successfully updated with new nickname."),setTimeout(()=>{document.getElementById("nickname").innerText=e,console.log("Nickname has been updated on the page.")},1e3)}catch(e){console.error("Error updating nickname:",e)}}}else alert("您尚未登录,请登录后再尝试修改昵称。")}async function uploadAvatar(t){t=t.target.files[0];if(t&&t.size<=1048576)if(!0===s){var n=`user/${curemail}/p.json`,o=`user/${curemail}/avatar`;try{var i,a=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/"+n);let e;e=a.ok?await a.json():{h:[hashedPassword],nickname:"默认昵称",hasAvatar:!1},await client.put(o,t),console.log("Avatar has been successfully uploaded."),e.hasAvatar?setTimeout(()=>{document.getElementById("myinfoavatar").src+="?"+(new Date).getTime(),console.log("Forced reload of the existing avatar.")},2e3):(e.hasAvatar=!0,i=new Blob([JSON.stringify(e)],{type:"application/json"}),await client.put(n,i),console.log("p.json has been successfully uploaded."),setTimeout(()=>{document.getElementById("myinfoavatar").src="https://download.xn--xhq44jb2fzpc.com/"+o,console.log("myinfoavatar's src has been updated to the new avatar.")},2e3))}catch(e){console.error("Failed to upload new avatar or update p.json:",e)}}else alert("You are not logged in, please log in before attempting to upload an avatar.");else alert("头像必须小于 1MB!")}buttons.forEach(e=>{e.addEventListener("click",function(){buttons.forEach(e=>e.classList.remove("selected")),this.classList.add("selected")})}),document.body.addEventListener("click",e=>{var t=document.getElementById("tooltip"),n=document.getElementById("verified-icon"),o=document.getElementById("invited-icon");n.contains(e.target)||o.contains(e.target)||t.contains(e.target)||hideTooltip()}),document.getElementById("editNicknameBtn").addEventListener("click",editNickname),document.querySelector(".overlay").addEventListener("click",function(){document.getElementById("fileInput").click()});let input=document.getElementById("input");async function fetchSubmittedCount(e){e=`https://download.xn--xhq44jb2fzpc.com/upload/${e}/submitted.json`;try{var t=await fetchNoCache(e);if(!t.ok)throw new Error("File not found or access error");var n=await t.json();submitted=n,console.log("Submitted count updated:",submitted)}catch(e){submitted=0,console.log("Error fetching submitted count:",e)}}async function fetchSubmissionData(t,n){let o=`
## 投稿记录
| 标题 | 板块 | 审核状态 | 审核备注 |
|------|------|------|------|`;for(let e=1;e<=n;e++){var i=`https://download.xn--xhq44jb2fzpc.com/upload/${t}/${e}/status.json`;try{var a=await fetchNoCache(i);if(a.ok){var{title:l,section:s,status:c,note:r,link:d}=await a.json();let e=l||"无标题";"已通过"===c&&d&&(e=`${e}`),o+=`
| ${e} | ${s||"无板块"} | ${c||"无状态"} | ${r||""} |`}else console.error(`无法获取 ${i}: ${a.status} `+a.statusText)}catch(e){console.error(`请求 ${i} 时发生错误:`,e)}}0===n&&(o+=`
-| 没有投稿记录 | | | |`),document.getElementById("mysubmission").innerHTML=marked.parse(o)}function validateFiles(n){var o=n.target.files;if(10`;document.getElementById("imageUrl").innerText=i,document.getElementById("imagePreview").src=o,document.getElementById("imagePreview").style.display="block",document.getElementById("copyButton").style.display="inline-block"}catch(e){console.error("图片上传失败:",e),alert("图片上传失败!"),t.target.value=""}}else alert("请先选择图片文件!");else alert("您还没有登录,请登录后再上传图片!")}function copyImageUrl(){var e=document.getElementById("imageUrl").innerText,t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy");alert(n?"标签已复制到剪贴板!请直接粘贴到 markdown 编辑区中,并根据预览效果调整大小。":"复制失败!")}catch(e){alert("复制失败!",e)}document.body.removeChild(t)}window.onload=function(){displayBeijingTime()},document.getElementById("SubmitButton").onclick=function(){let u=document.getElementById("section").value,m=document.querySelector("input[name='wp']").value.trim(),p=document.querySelector("input[name='wppassword']").value.trim();document.querySelector("input[name='note']").value.trim();let f=simplemde.value().trim();confirm("请仔细检查后提交,多次提交无关内容将被禁止访问网站!")&&!async function(){if(s){var t=curemail,e=document.querySelector("input[name='title']").value.trim();if(e){var n=submitted+1;try{var o=await fetch(`https://download.xn--xhq44jb2fzpc.com/user/${t}/p.json`);if(!o.ok)throw new Error("无法加载用户数据");var i=(await o.json()).nickname||"未知昵称",a=`时间:${getBeijingTime()}
+| 没有投稿记录 | | | |`),document.getElementById("mysubmission").innerHTML=marked.parse(o)}function validateFiles(n){var o=n.target.files;if(10`;document.getElementById("imageUrl").innerText=i,document.getElementById("imagePreview").src=o,document.getElementById("imagePreview").style.display="block",document.getElementById("copyButton").style.display="inline-block"}catch(e){console.error("图片上传失败:",e),alert("图片上传失败!"),t.target.value=""}}else alert("请先选择图片文件!");else alert("您还没有登录,请登录后再上传图片!")}function copyImageUrl(){var e=document.getElementById("imageUrl").innerText,t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{var n=document.execCommand("copy");alert(n?"标签已复制到剪贴板!请直接粘贴到 markdown 编辑区中,并根据预览效果调整大小。":"复制失败!")}catch(e){alert("复制失败!",e)}document.body.removeChild(t)}window.onload=function(){displayBeijingTime()},document.getElementById("SubmitButton").onclick=function(){let m=document.getElementById("section").value,u=document.querySelector("input[name='wp']").value.trim(),p=document.querySelector("input[name='wppassword']").value.trim();document.querySelector("input[name='note']").value.trim();let y=simplemde.value().trim();confirm("请仔细检查后提交,多次提交无关内容将被禁止访问网站!")&&!async function(){if(s){var t=curemail,e=document.querySelector("input[name='title']").value.trim();if(e){var n=submitted+1;try{var o=await fetch(`https://download.xn--xhq44jb2fzpc.com/user/${t}/p.json`);if(!o.ok)throw new Error("无法加载用户数据");var i=(await o.json()).nickname||"未知昵称",a=`时间:${getBeijingTime()}
内容标题:${e}
邮箱:${t}
-板块:${u}
+板块:${m}
昵称:${i}
备注:${""}
-网盘外链:${m}
+网盘外链:${u}
网盘提取密码:${p}
资源展示页:
-`+f,l=`upload/${t}/${n}/userinfo.txt`,c=`upload/${t}/${n}/status.json`,r={title:e,status:"审核中",section:u,note:"",link:""},d=(await client.put(l,new Blob([a],{type:"text/plain"})),await client.put(c,new Blob([JSON.stringify(r)],{type:"application/json"})),document.getElementById("filePicker").files);for(let e=0;e{if(s){if(confirm("确认保存草稿吗?如您之前有草稿内容,此操作会覆盖前一次的草稿内容。")){var e=simplemde.value(),t=`upload/${curemail}/${submitted+1}/draft.json`,e=new Blob([JSON.stringify({content:e},null,2)],{type:"application/json"});try{await client.put(t,e),alert("草稿已保存!")}catch(e){console.error("保存草稿时出错:",e),alert("保存草稿失败,请稍后再试。")}}}else alert("非法操作!请先登录。")}),document.getElementById("LoadDraft").addEventListener("click",async()=>{if(s){var e=`https://download.xn--xhq44jb2fzpc.com/upload/${curemail}/${submitted+1}/draft.json`;try{var t=await fetchNoCache(e);if(t.ok){var n=await t.json();confirm("此操作会覆盖您当前的输入内容,确认加载草稿吗?")&&(simplemde.value(n.content),alert("草稿已加载!"))}else{if(404!==t.status)throw new Error("无法加载草稿内容");alert("没有草稿记录!")}}catch(e){console.error("加载草稿时出错:",e),alert("加载草稿失败,请稍后再试。")}}else alert("非法操作!请先登录。")});
\ No newline at end of file
+`+y,l=`upload/${t}/${n}/userinfo.txt`,c=`upload/${t}/${n}/status.json`,r={title:e,status:"审核中",section:m,note:"",link:""},d=(await client.put(l,new Blob([a],{type:"text/plain"})),await client.put(c,new Blob([JSON.stringify(r)],{type:"application/json"})),document.getElementById("filePicker").files);for(let e=0;e{if(s){if(confirm("确认保存草稿吗?如您之前有草稿内容,此操作会覆盖前一次的草稿内容。")){var e=simplemde.value(),t=`upload/${curemail}/${submitted+1}/draft.json`,e=new Blob([JSON.stringify({content:e},null,2)],{type:"application/json"});try{await client.put(t,e),alert("草稿已保存!")}catch(e){console.error("保存草稿时出错:",e),alert("保存草稿失败,请稍后再试。")}}}else alert("非法操作!请先登录。")}),document.getElementById("LoadDraft").addEventListener("click",async()=>{if(s){var e=`https://download.xn--xhq44jb2fzpc.com/upload/${curemail}/${submitted+1}/draft.json`;try{var t=await fetchNoCache(e);if(t.ok){var n=await t.json();confirm("此操作会覆盖您当前的输入内容,确认加载草稿吗?")&&(simplemde.value(n.content),alert("草稿已加载!"))}else{if(404!==t.status)throw new Error("无法加载草稿内容");alert("没有草稿记录!")}}catch(e){console.error("加载草稿时出错:",e),alert("加载草稿失败,请稍后再试。")}}else alert("非法操作!请先登录。")});
\ No newline at end of file
diff --git a/log/index.html b/log/index.html
index d4c9653..e895594 100644
--- a/log/index.html
+++ b/log/index.html
@@ -7,7 +7,7 @@
更新日志 | NEU小站
-
-
+
@@ -240,7 +240,12 @@
-
2024.08#
+
2024.09#
+
09.01#
+
+
2024.08#
08.31#