删除js文件
This commit is contained in:
parent
fa8d20103c
commit
3bf6f091df
333
js/coin.js
333
js/coin.js
File diff suppressed because it is too large
Load Diff
14
js/coin.min.js
vendored
14
js/coin.min.js
vendored
@ -1,14 +0,0 @@
|
||||
function loadCoinSystem(){function d(r){let a=document.getElementById("coin-content"),s=1;function c(e){e=10*(e-1),e=r.transactions.slice(e,10+e);let t=a.querySelector("table");t?t.innerHTML=t.rows[0].innerHTML:((t=document.createElement("table")).insertRow().innerHTML="<th>时间</th><th>明细</th><th>操作</th>",a.appendChild(t)),e.forEach(e=>{t.insertRow().innerHTML=`
|
||||
<td>${e.date}</td>
|
||||
<td>${"credit"===e.type?"+":"-"}${e.amount}</td>
|
||||
<td>${e.description}</td>
|
||||
`})}a.innerHTML=`
|
||||
<p><strong>当前东币数:${r.coins}</strong></p>
|
||||
<p>下载某些资源时会花费东币,而投稿审核通过后可以获得东币。</p>
|
||||
<p><strong>请注意:</strong>由于下载同一份文件两次,从服务器流出的下行流量也会计算两次,因此当您多次下载同一个需要东币的资源时,东币也会多次扣除。<strong>我们建议您减少不必要的重复下载。</strong></p>
|
||||
<p><strong>每页显示10条东币记录,最近的记录将显示在最后。</strong></p>
|
||||
`,c(s),function t(){var n=Math.ceil(r.transactions.length/10),o=document.createElement("div"),e=(o.className="pagination",document.createElement("span"));o.appendChild(e);for(let e=1;e<=n;e++){var i=document.createElement("button");i.textContent=e,i.className="page-link",i.style.margin="0 5px",i.style.fontWeight=e===s?"bold":"normal",i.disabled=e===s,i.addEventListener("click",()=>{c(s=e),t()}),o.appendChild(i)}e=a.querySelector(".pagination");e&&a.removeChild(e),a.appendChild(o)}()}function o(){let a=document.getElementById("verification-modal"),o=(a.style.display="block",document.getElementById("send-code-btn")),s=document.getElementById("verify-btn"),i=document.getElementById("phone-number"),c=document.getElementById("verification-code"),l=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)?(l.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?(l.innerText="验证码已发送。若未收到,2分钟后可重新发送。",sessionStorage.setItem("phoneNumber",e)):(l.innerText="发送失败!请稍后再试。",o.disabled=!1,o.textContent="发送验证码"))}catch(e){l.innerText="发送验证码时出错,请稍后重试。",o.disabled=!1,o.textContent="发送验证码"}else l.innerText="请输入有效的11位手机号码!"}),s.addEventListener("click",async()=>{var e=sessionStorage.getItem("phoneNumber"),t=c.value.trim();if(l.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?(l.innerText="验证通过,请稍后……",s.disabled=!0,c.disabled=!0,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"})),await client.put(`user/${curemail}/pn.json`,new Blob([JSON.stringify({phoneNumber:e})],{type:"application/json"})),setTimeout(async()=>{a.style.display="none";var e={userEmail:curemail,coins:50,transactions:[{type:"credit",amount:50,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)):l.innerText="验证码错误,请重新输入。"}catch(e){l.innerText="验证时出错,请稍后重试。"}else l.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=`
|
||||
<p>您需要进行手机验证以解锁东币系统。下载某些资源时会花费东币,而投稿审核通过后可以获得东币。</p>
|
||||
<p><strong>请注意:</strong>由于下载同一份文件两次,从服务器流出的下行流量也会计算两次,因此当您多次下载同一个需要东币的资源时,东币也会多次扣除。<strong>我们建议您减少不必要的重复下载。</strong></p>
|
||||
<button id="first-verify-btn">验证</button>
|
||||
`,document.getElementById("first-verify-btn")),n=(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",document.body.classList.contains("dark"));n&&(t.style.backgroundColor="#444",t.style.color="#fff");t.onmouseover=function(){n?t.style.backgroundColor="#555":t.style.backgroundColor="#0056b3"},t.onmouseout=function(){n?t.style.backgroundColor="#444":t.style.backgroundColor="#007BFF"},t.onmousedown=function(){n?t.style.backgroundColor="#333":t.style.backgroundColor="#003f7f"},t.addEventListener("click",o);return}}}()}
|
File diff suppressed because it is too large
Load Diff
1
js/dl.min.js
vendored
1
js/dl.min.js
vendored
@ -1 +0,0 @@
|
||||
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<n?(r.textContent=n+"秒后将开始下载...",n--,setTimeout(t,1e3)):(c.style.display="none",window.location.href=e)};c.style.display="block",t()}else console.error("Failed to initialize OSS client due to decryption error.")}).catch(e=>{console.log("Error initializing OSS Client:",e)})})}});
|
166
js/dlwithcoin.js
166
js/dlwithcoin.js
File diff suppressed because it is too large
Load Diff
1
js/dlwithcoin.min.js
vendored
1
js/dlwithcoin.min.js
vendored
@ -1 +0,0 @@
|
||||
let client;function getCookie(t){const n=t+"=";const o=document.cookie.split(";");for(let e=0;e<o.length;e++){let t=o[e];while(t.charAt(0)==" ")t=t.substring(1,t.length);if(t.indexOf(n)==0)return t.substring(n.length,t.length)}return null}async function fetchNoCache(t){const e=(new Date).getTime();const n=`${t}?timestamp=${e}`;return fetch(n)}async function f1(){try{const t=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/upload/json/s.json");const e=await t.json();const n=e.masterKey;const o=CryptoJS.SHA256(n);const c={region:d2(e.encryptedRegion,o),accessKeyId:d2(e.encryptedKeyId,o),accessKeySecret:d2(e.encryptedKeySecret,o),bucket:d2(e.encryptedBucket,o)};client=new OSS(c)}catch(t){console.error("Failed to fetch or decrypt OSS config:",t)}}function d2(t,e){t=t.replace(/\s/g,"");const n=CryptoJS.enc.Base64.parse(t);const o=CryptoJS.lib.WordArray.create(n.words.slice(0,4));const c=CryptoJS.lib.WordArray.create(n.words.slice(4));const s=CryptoJS.AES.decrypt({ciphertext:c},e,{iv:o,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return s.toString(CryptoJS.enc.Utf8)}f1();document.addEventListener("DOMContentLoaded",function(){const i="{{ .Get "id" }}";const r="{{ .Get "url" }}";const a="popup-"+i;const l={{ .Get "coin" | default 0 }};const d="{{ .Get "title" }}";const t=async()=>{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<l){alert(`您的金币数量不够!当前资源要求金币数:${l};您的金币数:${c.coins}。`);return}else{if(confirm(`当前下载操作花费:${l}金币;您的金币:${c.coins}。是否继续?`)){c.coins-=l;c.transactions.push({type:"debit",amount:l,description:`下载资源:${d}`,date:getCurrentTime()});const s=new Blob([JSON.stringify(c)],{type:"application/json"});await client.put(`user/${e}/coin/list.json`,s);p(i,a,r)}}}catch(t){console.error("Error handling coins for download:",t);alert("无法处理您的请求,请稍后重试。")}}else{p(i,a,r)}};const p=(t,e,n)=>{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)}
|
@ -1 +0,0 @@
|
||||
let client;async function fetchNoCache(e){const t=(new Date).getTime();const n=`${e}?timestamp=${t}`;return fetch(n)}async function f1(){try{const e=await fetchNoCache("https://download.xn--xhq44jb2fzpc.com/download/json/s.json");const t=await e.json();const n=t.masterKey;const o=CryptoJS.SHA256(n);const c={region:d2(t.encryptedRegion,o),accessKeyId:d2(t.encryptedKeyId,o),accessKeySecret:d2(t.encryptedKeySecret,o),bucket:d2(t.encryptedBucket,o)};client=new OSS(c)}catch(e){console.error("Failed to fetch or decrypt OSS config:",e)}}function d2(e,t){e=e.replace(/\s/g,"");const n=CryptoJS.enc.Base64.parse(e);const o=CryptoJS.lib.WordArray.create(n.words.slice(0,4));const c=CryptoJS.lib.WordArray.create(n.words.slice(4));const r=CryptoJS.AES.decrypt({ciphertext:c},t,{iv:o,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return r.toString(CryptoJS.enc.Utf8)}
|
1
js/qv.min.js
vendored
1
js/qv.min.js
vendored
@ -1 +0,0 @@
|
||||
let client;async function f1(){try{var e=await(await fetch("https://download.xn--xhq44jb2fzpc.com/upload/json/s.json")).json(),t=e.masterKey,o=CryptoJS.SHA256(t),n={region:d2(e.encryptedRegion,o),accessKeyId:d2(e.encryptedKeyId,o),accessKeySecret:d2(e.encryptedKeySecret,o),bucket:d2(e.encryptedBucket,o)};client=new OSS(n)}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),o=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:o,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8)}function getCookie(e){var o=e+"=",n=document.cookie.split(";");for(let t=0;t<n.length;t++){let e=n[t];for(;" "==e.charAt(0);)e=e.substring(1,e.length);if(0==e.indexOf(o))return e.substring(o.length,e.length)}return null}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 loggedIn=getCookie("loggedIn"),email=getCookie("userEmail");if(loggedIn&&email){let e=async()=>{try{var e=await fetch(`https://download.xn--xhq44jb2fzpc.com/user/${email}/qv.json`);e.ok&&!0===await e.json()&&(alert("您已经完成验证,无需再次验证!"),window.location.href="/submission")}catch(e){console.log("没有找到验证文件,继续验证流程。")}};e(),document.getElementById("verifybtn").addEventListener("click",async()=>{try{if((await(await fetch("https://ipquery.xn--xhq44jb2fzpc.com/api/check-ip")).json()).data.isInNeU){var e=new Blob([JSON.stringify(!0)],{type:"application/json"});try{await client.put(`user/${email}/qv.json`,e),alert("您已完成验证!"),window.location.href="/submission"}catch(e){console.error("OSS写入失败:",e),alert("验证失败,请稍后重试。")}}else alert("您未连接NEU校园网,请连接后重试!")}catch(e){console.error("IP验证失败:",e),alert("验证失败,请稍后重试。")}})}else alert("您未登录,请先登录后操作!"),window.location.href="/submission";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user