更正错误

This commit is contained in:
Ember 2024-09-04 13:15:57 +08:00
parent fa43f1721f
commit 210f1e2641
6 changed files with 11 additions and 11 deletions

View File

@ -61,13 +61,13 @@ document.addEventListener("DOMContentLoaded", function() {
// const linkId = "{{ .Get "id" }}"; // const linkId = "{{ .Get "id" }}";
// const objectKey = "{{ .Get "url" }}"; // 使用URL参数作为OSS对象的key // const objectKey = "{{ .Get "url" }}"; // 使用URL参数作为OSS对象的key
// const popupId = "popup-" + linkId; // const popupId = "popup-" + linkId;
// const requiredCoins = {{ .Get "coin" | default 0 }}; // 获取需要扣除的币数默认为0 // const requiredCoins = {{ .Get "coin" | default 0 }}; // 获取需要扣除的币数默认为0
// const resourceTitle = "{{ .Get "title" }}"; // 获取资源标题 // const resourceTitle = "{{ .Get "title" }}"; // 获取资源标题
const linkId = "aaa"; const linkId = "aaa";
const objectKey = "bbb"; // 使用URL参数作为OSS对象的key const objectKey = "bbb"; // 使用URL参数作为OSS对象的key
const popupId = "popup-" + linkId; const popupId = "popup-" + linkId;
const requiredCoins = 666; // 获取需要扣除的币数默认为0 const requiredCoins = 666; // 获取需要扣除的币数默认为0
const resourceTitle = "ccc" const resourceTitle = "ccc"
const checkAndDownload = async () => { const checkAndDownload = async () => {
@ -85,16 +85,16 @@ document.addEventListener("DOMContentLoaded", function() {
try { try {
const response = await fetchNoCache(coinListUrl); const response = await fetchNoCache(coinListUrl);
if (!response.ok) { if (!response.ok) {
alert("您还未激活币系统,请前往激活!"); alert("您还未激活币系统,请前往激活!");
window.location.href = "/submission"; window.location.href = "/submission";
return; return;
} }
const data = await response.json(); const data = await response.json();
if (data.coins < requiredCoins) { if (data.coins < requiredCoins) {
alert(`您的金币数量不够!当前资源要求金币数:${requiredCoins};您的金币数:${data.coins}`); alert(`您的东币数量不够!当前资源要求东币数:${requiredCoins};您的东币数:${data.coins}`);
return; return;
} else { } else {
if (confirm(`当前下载操作花费:${requiredCoins}金币;您的金币:${data.coins}。是否继续?`)) { if (confirm(`当前下载操作花费:${requiredCoins}东币;您的东币:${data.coins}。是否继续?`)) {
data.coins -= requiredCoins; data.coins -= requiredCoins;
data.transactions.push({ data.transactions.push({
type: "debit", type: "debit",
@ -114,7 +114,7 @@ document.addEventListener("DOMContentLoaded", function() {
alert("无法处理您的请求,请稍后重试。"); alert("无法处理您的请求,请稍后重试。");
} }
} else { } else {
// 如果不需要币,直接开始下载 // 如果不需要币,直接开始下载
startDownload(linkId, popupId, objectKey); startDownload(linkId, popupId, objectKey);
} }
}; };

View File

@ -467,7 +467,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= 5 ;const d="《习近平新时代中国特色社会主义思想概论》课本";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)} 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= 5 ;const d="《习近平新时代中国特色社会主义思想概论》课本";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)}
</script> </script>
<hr> <hr>

View File

@ -467,7 +467,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\/公路交通\/公路交通与汽车驾驶完整版PPT.pdf";const a="popup-"+i;const l= 8 ;const d="《公路交通与驾驶技术》完整版PPT";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)} 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\/公路交通\/公路交通与汽车驾驶完整版PPT.pdf";const a="popup-"+i;const l= 8 ;const d="《公路交通与驾驶技术》完整版PPT";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)}
</script> </script>
<hr> <hr>

View File

@ -470,7 +470,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= 10 ;const d="《数值分析》课本";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)} 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= 10 ;const d="《数值分析》课本";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)}
</script> </script>
<hr> <hr>

View File

@ -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 d="《概率论与数理统计》期末真题合集";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)} 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 d="《概率论与数理统计》期末真题合集";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)}
</script> </script>
<hr> <hr>

View File

@ -463,7 +463,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\/马原\/马克思主义基本原理(2023版) (本书编写组).pdf";const a="popup-"+i;const l= 5 ;const d="《马克思主义基本原理》课本2023版";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)} 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\/马原\/马克思主义基本原理(2023版) (本书编写组).pdf";const a="popup-"+i;const l= 5 ;const d="《马克思主义基本原理》课本2023版";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)}
</script> </script>
<hr> <hr>