修改资源错误
This commit is contained in:
parent
9a3fbd1630
commit
543f399c92
@ -480,7 +480,7 @@
|
|||||||
<div class="popup-content">3秒后将开始下载...</div>
|
<div class="popup-content">3秒后将开始下载...</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
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="download-1";const r="resources\/files\/概率论\/概率论与数理统计参考答案.pdf";const a="popup-"+i;const l= 15 ;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:"下载资源",date:getCurrentTime()});const s=new Blob([JSON.stringify(c)],{type:"application/json"});await client.put(`user/${e}/coin/list.json`,s);d(i,a,r)}}}catch(t){console.error("Error handling coins for download:",t);alert("无法处理您的请求,请稍后重试。")}}else{d(i,a,r)}};const d=(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)}
|
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="download-1";const r="resources\/files\/概率论\/概率论期末考试题及答案.pdf";const a="popup-"+i;const l= 15 ;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:"下载资源",date:getCurrentTime()});const s=new Blob([JSON.stringify(c)],{type:"application/json"});await client.put(`user/${e}/coin/list.json`,s);d(i,a,r)}}}catch(t){console.error("Error handling coins for download:",t);alert("无法处理您的请求,请稍后重试。")}}else{d(i,a,r)}};const d=(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)}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user