Files
jk8_admin/public/assets/login-DecGjfGk.js
2026-06-17 16:22:28 +08:00

2 lines
5.5 KiB
JavaScript

var j=Object.defineProperty;var K=(a,n,u)=>n in a?j(a,n,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[n]=u;var f=(a,n,u)=>K(a,typeof n!="symbol"?n+"":n,u);import{B as W,a as _,o as G,n as O,j as Y,D as E,G as c,H as o,P as r,a6 as Z,u as m,a7 as J,I as d,a8 as v,C as x,Z as Q,Y as X,O as ee,V as L,U as R}from"./vue-DweYBrEc.js";import{e as te,w as oe,x as ae,y as ne,g as se,f as le,r as ie,z as re,_ as ce}from"./index-fNs72j9w.js";import{l as B}from"./index-CLJRKiC0.js";import{b as w}from"./validate-CEOscgyN.js";import{c as de}from"./index-CYWPsgm-.js";import{t as ue}from"./useDark-DHNZxxpN.js";const me="/assets/login-header-C_4yz5CA.png",e={width:0,height:0,bubbleEl:null,canvas:null,ctx:{},circles:[],animate:!0,requestId:null},pe=function(){e.width=window.innerWidth,e.height=window.innerHeight,e.bubbleEl=document.getElementById("bubble"),e.bubbleEl.style.height=e.height+"px",e.canvas=document.getElementById("bubble-canvas"),e.canvas.width=e.width,e.canvas.height=e.height,e.ctx=e.canvas.getContext("2d"),e.circles=[];for(let a=0;a<e.width*.5;a++){const n=new fe;e.circles.push(n)}q(),he()};function P(){e.animate=!(document.body.scrollTop>e.height)}function M(){e.width=window.innerWidth,e.height=window.innerHeight,e.bubbleEl.style.height=e.height+"px",e.canvas.width=e.width,e.canvas.height=e.height}function q(){if(e.animate){e.ctx.clearRect(0,0,e.width,e.height);for(const a in e.circles)e.circles[a].draw()}e.requestId=requestAnimationFrame(q)}class fe{constructor(){f(this,"pos");f(this,"alpha");f(this,"scale");f(this,"velocity");f(this,"draw");this.pos={x:Math.random()*e.width,y:e.height+Math.random()*100},this.alpha=.1+Math.random()*.3,this.scale=.1+Math.random()*.3,this.velocity=Math.random(),this.draw=function(){this.pos.y-=this.velocity,this.alpha-=5e-4,e.ctx.beginPath(),e.ctx.arc(this.pos.x,this.pos.y,this.scale*10,0,2*Math.PI,!1),e.ctx.fillStyle="rgba(255,255,255,"+this.alpha+")",e.ctx.fill()}}}function he(){window.addEventListener("scroll",P),window.addEventListener("resize",M)}function ge(){window.removeEventListener("scroll",P),window.removeEventListener("resize",M),cancelAnimationFrame(e.requestId)}const we={class:"switch-language"},be={class:"login"},_e={class:"login-box"},ve={class:"form"},xe=["src"],ye={class:"content"},ke=W({__name:"login",setup(a){let n;const u=te(),D=oe();ue(u.layout.isDark);const y=v("formRef"),k=v("usernameRef"),I=v("passwordRef"),h=_({showCaptcha:!1,submitLoading:!1}),s=_({username:"",password:"",keep:!1,captchaId:ne(),captchaInfo:""}),{t:p}=ae.useI18n(),T=_({username:[w({name:"required",message:p("login.Please enter an account")}),w({name:"account"})],password:[w({name:"required",message:p("login.Please input a password")}),w({name:"password"})]}),U=()=>{var l,t;s.username===""?(l=k.value)==null||l.focus():s.password===""&&((t=I.value)==null||t.focus())};G(()=>{n=window.setTimeout(()=>{pe()},1e3),B("get").then(l=>{h.showCaptcha=l.data.captcha,O(()=>U())}).catch(l=>{console.log(l)})}),Y(()=>{clearTimeout(n),ge()});const C=()=>{var l;(l=y.value)==null||l.validate(t=>{t&&(h.showCaptcha?de(s.captchaId,g=>V(g)):V())})},V=(l="")=>{h.submitLoading=!0,s.captchaInfo=l,B("post",s).then(t=>{D.dataFill(t.data.userInfo,!1),ie.push({path:re})}).finally(()=>{h.submitLoading=!1})};return(l,t)=>{const g=d("Icon"),A=d("el-dropdown-item"),S=d("el-dropdown-menu"),F=d("el-dropdown"),z=d("el-input"),b=d("el-form-item"),H=d("el-checkbox"),$=d("el-button"),N=d("el-form");return x(),E("div",null,[c("div",we,[o(F,{size:"large","hide-timeout":50,placement:"bottom-end","hide-on-click":!0},{dropdown:r(()=>[o(S,{class:"chang-lang"},{default:r(()=>[(x(!0),E(Q,null,X(m(u).lang.langArray,i=>(x(),ee(A,{key:i.name,onClick:Ie=>m(se)(i.name)},{default:r(()=>[L(R(i.value),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),default:r(()=>[o(g,{name:"fa fa-globe",color:"var(--el-text-color-secondary)",size:"28"})]),_:1})]),c("div",{onContextmenu:t[0]||(t[0]=Z(()=>{},["stop"])),id:"bubble",class:"bubble"},t[6]||(t[6]=[c("canvas",{id:"bubble-canvas",class:"bubble-canvas"},null,-1)]),32),c("div",be,[c("div",_e,[t[7]||(t[7]=c("div",{class:"head"},[c("img",{src:me,alt:"login"})],-1)),c("div",ve,[c("img",{class:"profile-avatar",src:m(le)("/static/images/avatar.png"),alt:"avatar"},null,8,xe),c("div",ye,[o(N,{onKeyup:t[5]||(t[5]=J(i=>C(),["enter"])),ref_key:"formRef",ref:y,rules:T,size:"large",model:s},{default:r(()=>[o(b,{prop:"username"},{default:r(()=>[o(z,{ref_key:"usernameRef",ref:k,type:"text",clearable:"",modelValue:s.username,"onUpdate:modelValue":t[1]||(t[1]=i=>s.username=i),placeholder:m(p)("login.Please enter an account")},{prefix:r(()=>[o(g,{name:"fa fa-user",class:"form-item-icon",size:"16",color:"var(--el-input-icon-color)"})]),_:1},8,["modelValue","placeholder"])]),_:1}),o(b,{prop:"password"},{default:r(()=>[o(z,{ref_key:"passwordRef",ref:I,modelValue:s.password,"onUpdate:modelValue":t[2]||(t[2]=i=>s.password=i),type:"password",placeholder:m(p)("login.Please input a password"),"show-password":""},{prefix:r(()=>[o(g,{name:"fa fa-unlock-alt",class:"form-item-icon",size:"16",color:"var(--el-input-icon-color)"})]),_:1},8,["modelValue","placeholder"])]),_:1}),o(H,{modelValue:s.keep,"onUpdate:modelValue":t[3]||(t[3]=i=>s.keep=i),label:m(p)("login.Hold session"),size:"default"},null,8,["modelValue","label"]),o(b,null,{default:r(()=>[o($,{loading:h.submitLoading,class:"submit-button",type:"primary",size:"large",onClick:t[4]||(t[4]=i=>C())},{default:r(()=>[L(R(m(p)("login.Sign in")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["rules","model"])])])])])])}}}),Pe=ce(ke,[["__scopeId","data-v-da1b9e9d"]]);export{Pe as default};