Comparing version 1.0.20 to 1.0.21
@@ -1,2 +0,2 @@ | ||
const domain="/api";var main_index=0;function getFetch(n){return new Promise((t,e)=>{fetch(domain+n,{method:"GET"}).then(e=>e.json()).then(e=>{105!==e.code&&300!==e.code||(clearCookie("user_token"),alert(e.msg)),t(e)})})}function getPost(i,a){return new Promise((t,e)=>{var n={method:"POST",body:JSON.stringify(a),headers:{"content-type":"application/json"}};fetch(domain+i,n).then(e=>e.json()).then(e=>{t(e.data)})})}function getLoginRegister(e,t){document.querySelector(".pop_content form .loading").style.display="flex";t={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)};fetch(domain+e,t).then(e=>e.json()).then(e=>{var t;0===e.code?((t=new Date).setTime(t.getTime()+1728e5),document.cookie=`user_token=${e.data.token}; expires=${t.toUTCString()}; path=/`,localStorage.setItem("uuid",e.data.uid),localStorage.setItem("nikename",e.data.nikename||e.data.user_phone),location.reload()):(document.querySelector(".pop_content form .loading").style.display="none",t=e.msg.replace("\u5c0f\u7a0b\u5e8f",""),alert(t))})}function checkCookie(e){for(const i of document.cookie.split(";")){var[t,n]=i.trim().split("=");if(t===e)return n}return!1}function clearCookie(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",localStorage.removeItem("nikename"),localStorage.removeItem("uuid"),location.reload()}function openPopShowTap(){var e=document.querySelector(".pop_show_box"),t=document.getElementById("login_form"),n=document.getElementById("register_form"),i=document.querySelector(".pop_content .head .title");"flex"===e.style.display?e.style.display="none":(e.style.display="flex",t.style.display="block",n.style.display="none",i.textContent="\u7528\u6237\u767b\u5f55")}function loginFunction(){document.querySelector(".pop_show_box");let n=document.getElementById("login_form"),i=document.getElementById("register_form"),a=document.querySelector(".pop_content .head .title");document.querySelectorAll(".closepop").forEach(e=>{e.addEventListener("click",function(e){openPopShowTap()})}),document.querySelectorAll(".pop_content .formbtn").forEach(t=>{t.addEventListener("click",function(e){e.preventDefault();e=t.getAttribute("type");"register"===e?(n.style.display="none",i.style.display="block",a.textContent="\u7528\u6237\u6ce8\u518c"):"login"===e?(n.style.display="block",i.style.display="none",a.textContent="\u7528\u6237\u767b\u5f55"):getFetch("/login/random/account").then(e=>{var t;0===e.code&&(alert(`游客注册成功 | ||
const domain="/xapi";var main_index=0;function getFetch(n){return new Promise((t,e)=>{fetch(domain+n,{method:"GET"}).then(e=>e.json()).then(e=>{105!==e.code&&300!==e.code||(clearCookie("user_token"),alert(e.msg)),t(e)})})}function getPost(i,a){return new Promise((t,e)=>{var n={method:"POST",body:JSON.stringify(a),headers:{"content-type":"application/json"}};fetch(domain+i,n).then(e=>e.json()).then(e=>{t(e.data)})})}function getLoginRegister(e,t){document.querySelector(".pop_content form .loading").style.display="flex";t={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)};fetch(domain+e,t).then(e=>e.json()).then(e=>{var t;0===e.code?((t=new Date).setTime(t.getTime()+1728e5),document.cookie=`user_token=${e.data.token}; expires=${t.toUTCString()}; path=/`,localStorage.setItem("uuid",e.data.uid),localStorage.setItem("nikename",e.data.nikename||e.data.user_phone),location.reload()):(document.querySelector(".pop_content form .loading").style.display="none",t=e.msg.replace("\u5c0f\u7a0b\u5e8f",""),alert(t))})}function checkCookie(e){for(const i of document.cookie.split(";")){var[t,n]=i.trim().split("=");if(t===e)return n}return!1}function clearCookie(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",localStorage.removeItem("nikename"),localStorage.removeItem("uuid"),location.reload()}function openPopShowTap(){var e=document.querySelector(".pop_show_box"),t=document.getElementById("login_form"),n=document.getElementById("register_form"),i=document.querySelector(".pop_content .head .title");"flex"===e.style.display?e.style.display="none":(e.style.display="flex",t.style.display="block",n.style.display="none",i.textContent="\u7528\u6237\u767b\u5f55")}function loginFunction(){document.querySelector(".pop_show_box");let n=document.getElementById("login_form"),i=document.getElementById("register_form"),a=document.querySelector(".pop_content .head .title");document.querySelectorAll(".closepop").forEach(e=>{e.addEventListener("click",function(e){openPopShowTap()})}),document.querySelectorAll(".pop_content .formbtn").forEach(t=>{t.addEventListener("click",function(e){e.preventDefault();e=t.getAttribute("type");"register"===e?(n.style.display="none",i.style.display="block",a.textContent="\u7528\u6237\u6ce8\u518c"):"login"===e?(n.style.display="block",i.style.display="none",a.textContent="\u7528\u6237\u767b\u5f55"):getFetch("/login/random/account").then(e=>{var t;0===e.code&&(alert(`游客注册成功 | ||
请记住您的账号密码 | ||
@@ -3,0 +3,0 @@ 账号:${e.data.user_phone} |
{ | ||
"name": "htmxskyjs", | ||
"private": false, | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "high power tools for html", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2724870