diff --git a/js/submission.js b/js/submission.js
index 9dc38cd..e49eb61 100644
--- a/js/submission.js
+++ b/js/submission.js
@@ -35,22 +35,22 @@ function setLoginCookie(email) {
function logout() {
+ const domain = window.location.hostname.includes('localhost') ? 'localhost' : `.${window.location.hostname.split('.').slice(-2).join('.')}`;
+
// 清除登录状态的 Cookie
- document.cookie = "loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT;";
- document.cookie = "userEmail=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT;";
+ document.cookie = `loggedIn=; domain=${domain}; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
+ document.cookie = `userEmail=; domain=${domain}; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT;`;
// 清除其他相关的状态变量
s = false;
curemail = "";
- // 显示退出登录的提示信息
- // alert("您已成功退出登录。");
-
// 重定向到登录页面或首页
window.location.href = "/submission"; // 请根据实际情况修改重定向地址
}
+
document.getElementById('loginForm').addEventListener('submit', async function(event) {
event.preventDefault();
const email = document.getElementById('email').value;
diff --git a/js/submission.min.js b/js/submission.min.js
index 521d741..db62d84 100644
--- a/js/submission.min.js
+++ b/js/submission.min.js
@@ -1,9 +1,9 @@
-let client,s=!1;var curemail="",submitted=0;function getCookie(e){var n=e+"=",o=document.cookie.split(";");for(let t=0;t{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{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=`
## 投稿记录
| 标题 | 板块 | 审核状态 | 审核备注 |
-|------|------|------|------|`;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:r,status:s,note:c,link:d}=await a.json();let e=l||"无标题";"已通过"===s&&d&&(e=`${e}`),o+=`
-| ${e} | ${r||"无板块"} | ${s||"无状态"} | ${c||""} |`}else console.error(`无法获取 ${i}: ${a.status} `+a.statusText)}catch(e){console.error(`请求 ${i} 时发生错误:`,e)}}0===n&&(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:r,note:c,link:d}=await a.json();let e=l||"无标题";"已通过"===r&&d&&(e=`${e}`),o+=`
+| ${e} | ${s||"无板块"} | ${r||"无状态"} | ${c||""} |`}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()}
内容标题:${e}
邮箱:${t}
diff --git a/log/index.html b/log/index.html
index 556a79c..6fea870 100644
--- a/log/index.html
+++ b/log/index.html
@@ -208,8 +208,8 @@