调整东币
This commit is contained in:
parent
cde31bf6e8
commit
9a3fbd1630
File diff suppressed because one or more lines are too long
@ -340,6 +340,7 @@ $$
|
||||
此处收录了2014-2021学年的12套《概率论与数理统计》期末考试真题。
|
||||
页面已提供在线预览,推荐您使用全屏预览。
|
||||
温馨提示:手机端可能无法正常预览PDF文件。请使用电脑浏览器访问。
|
||||
下载该资源需要:15东币
|
||||
点击下载
下载安全保护中
3秒后将开始下载...
预览 </description>
|
||||
</item>
|
||||
<item>
|
||||
|
10
js/coin.js
10
js/coin.js
@ -110,6 +110,7 @@ function loadCoinSystem() {
|
||||
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') {
|
||||
@ -194,12 +195,16 @@ function loadCoinSystem() {
|
||||
const phonesData = await phonesResponse.json();
|
||||
phonesData.push(phoneHash);
|
||||
|
||||
// 写入加密后的手机号到 pn.json
|
||||
await client.put('user/pn.json', new Blob([JSON.stringify(phonesData)], { type: 'application/json' }));
|
||||
|
||||
// 写入未加密的手机号到用户特定的 pn.json
|
||||
await client.put(`user/${curemail}/pn.json`, new Blob([JSON.stringify({ phoneNumber })], { type: 'application/json' }));
|
||||
|
||||
setTimeout(async () => {
|
||||
modal.style.display = 'none';
|
||||
|
||||
// 初始化东币系统
|
||||
// 初始化金币系统
|
||||
const initialData = {
|
||||
userEmail: curemail,
|
||||
coins: 20,
|
||||
@ -218,7 +223,7 @@ function loadCoinSystem() {
|
||||
const coinBlob = new Blob([JSON.stringify(initialData)], { type: 'application/json' });
|
||||
await client.put(`user/${curemail}/coin/list.json`, coinBlob);
|
||||
|
||||
// 重新读取并渲染东币信息
|
||||
// 重新读取并渲染金币信息
|
||||
renderCoinContent(initialData);
|
||||
}, 2000);
|
||||
} else {
|
||||
@ -231,6 +236,7 @@ function loadCoinSystem() {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
2
js/coin.min.js
vendored
2
js/coin.min.js
vendored
@ -2,7 +2,7 @@ function loadCoinSystem(){function l(e){var t=document.getElementById("coin-cont
|
||||
<td>${e.date}</td>
|
||||
<td>${"credit"===e.type?"+":"-"}${e.amount}</td>
|
||||
<td>${e.description}</td>
|
||||
`}),t.appendChild(n)}function o(){let s=document.getElementById("verification-modal"),o=(s.style.display="block",document.getElementById("send-code-btn")),a=document.getElementById("verify-btn"),i=document.getElementById("phone-number"),c=document.getElementById("verification-code"),d=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)?(d.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?(d.innerText="验证码已发送。若未收到,2分钟后可重新发送。",sessionStorage.setItem("phoneNumber",e)):(d.innerText="发送失败!请稍后再试。",o.disabled=!1,o.textContent="发送验证码"))}catch(e){d.innerText="发送验证码时出错,请稍后重试。",o.disabled=!1,o.textContent="发送验证码"}else d.innerText="请输入有效的11位手机号码!"}),a.addEventListener("click",async()=>{var e=sessionStorage.getItem("phoneNumber"),t=c.value.trim();if(d.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?(d.innerText="验证通过,请稍后……",a.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"})),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),l(e)},2e3)):d.innerText="验证码错误,请重新输入。"}catch(e){d.innerText="验证时出错,请稍后重试。"}else d.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`;l(await(await fetchNoCache(n)).json())}catch(e){console.error("Error in initializeCoinSystem: ",e);{let e=document.getElementById("coin-content"),t=(e.innerHTML=`
|
||||
`}),t.appendChild(n)}function o(){let s=document.getElementById("verification-modal"),o=(s.style.display="block",document.getElementById("send-code-btn")),a=document.getElementById("verify-btn"),i=document.getElementById("phone-number"),c=document.getElementById("verification-code"),d=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)?(d.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?(d.innerText="验证码已发送。若未收到,2分钟后可重新发送。",sessionStorage.setItem("phoneNumber",e)):(d.innerText="发送失败!请稍后再试。",o.disabled=!1,o.textContent="发送验证码"))}catch(e){d.innerText="发送验证码时出错,请稍后重试。",o.disabled=!1,o.textContent="发送验证码"}else d.innerText="请输入有效的11位手机号码!"}),a.addEventListener("click",async()=>{var e=sessionStorage.getItem("phoneNumber"),t=c.value.trim();if(d.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?(d.innerText="验证通过,请稍后……",a.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()=>{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),l(e)},2e3)):d.innerText="验证码错误,请重新输入。"}catch(e){d.innerText="验证时出错,请稍后重试。"}else d.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`;l(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>
|
||||
|
@ -218,6 +218,7 @@
|
||||
此处收录了2014-2021学年的12套《概率论与数理统计》期末考试真题。
|
||||
页面已提供在线预览,推荐您使用全屏预览。
|
||||
温馨提示:手机端可能无法正常预览PDF文件。请使用电脑浏览器访问。
|
||||
下载该资源需要:15东币
|
||||
点击下载
下载安全保护中
3秒后将开始下载...
预览 </description>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -334,6 +334,7 @@ createCardSection('xzttk', '选择题');
|
||||
此处收录了2014-2021学年的12套《概率论与数理统计》期末考试真题。
|
||||
页面已提供在线预览,推荐您使用全屏预览。
|
||||
温馨提示:手机端可能无法正常预览PDF文件。请使用电脑浏览器访问。
|
||||
下载该资源需要:15东币
|
||||
点击下载
下载安全保护中
3秒后将开始下载...
预览 </p>
|
||||
</div>
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user