| 12 |
- var e=Object.defineProperty,t=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,o=(t,a,s)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s,i=(e,t)=>{for(var a in t||(t={}))l.call(t,a)&&o(e,a,t[a]);if(s)for(var a of s(t))r.call(t,a)&&o(e,a,t[a]);return e},n=(e,s)=>t(e,a(s));import{u,a as d,b as c,A as p,t as g,l as v,g as h,R as f,U as m,H as y}from"./index-CqEtSlNP.js";/* empty css *//* empty css *//* empty css */import{j as x,N as b,O as w,r as k,d as _,n as M,P as T,c as j,Q as B,G as P,R as L,u as $,S as O,U as I,V,W as C,X as E,Y as X,s as D,Z as S,C as U,_ as F,v as H,H as R,$ as z,F as A,a0 as Y,a1 as q,a2 as G,a3 as K,a4 as N,i as W,a5 as J,a6 as Q,D as Z,a7 as ee,a8 as te,a9 as ae,E as se,aa as le}from"./vendor-CnLKbIcc.js";import{_ as re}from"./_plugin-vue_export-helper-BCo6x5W8.js";import"./el-form-item-l0sNRNKZ.js";/* empty css */import{_ as oe}from"./index-BqI92Y-9.js";/* empty css *//* empty css */import{_ as ie}from"./LoginLeftView-QLZNgzmy.js";import"./index-CR-FpSC5.js";const ne=["innerHTML"],ue=re(x(n(i({},{name:"ArtDragVerify"}),{__name:"index",props:{value:{type:Boolean,default:!1},width:{default:"100%"},height:{default:40},text:{default:"按住滑块拖动"},successText:{default:"success"},background:{default:"#eee"},progressBarBg:{default:"#1385FF"},completedBg:{default:"#57D187"},circle:{type:Boolean,default:!1},radius:{default:"calc(var(--custom-radius) / 3 + 2px)"},handlerIcon:{default:""},successIcon:{default:""},handlerBg:{default:"#fff"},textSize:{default:"13px"},textColor:{default:"#333"}},emits:["handlerMove","update:value","passCallback"],setup(e,{expose:t,emit:a}){const s=a,l=e,r=b({isMoving:!1,x:0,isOk:!1}),{isOk:o}=w(r),i=k(),n=k(),u=k(),d=k();let c,p,g,v;const h=e=>{c=e.targetTouches[0].pageX,p=e.targetTouches[0].pageY},f=e=>{g=e.targetTouches[0].pageX,v=e.targetTouches[0].pageY,Math.abs(g-c)>Math.abs(v-p)&&e.preventDefault()};document.addEventListener("touchstart",h),document.addEventListener("touchmove",f,{passive:!1});const m=()=>{var e;return"string"==typeof l.width?(null==(e=i.value)?void 0:e.offsetWidth)||260:l.width};_((()=>{var e;null==(e=i.value)||e.style.setProperty("--textColor",l.textColor),M((()=>{var e,t;const a=m();null==(e=i.value)||e.style.setProperty("--width",Math.floor(a/2)+"px"),null==(t=i.value)||t.style.setProperty("--pwidth",-Math.floor(a/2)+"px")})),document.addEventListener("touchstart",h),document.addEventListener("touchmove",f,{passive:!1})})),T((()=>{document.removeEventListener("touchstart",h),document.removeEventListener("touchmove",f)}));const y={left:"0",width:l.height+"px",height:l.height+"px",background:l.handlerBg},x=j((()=>({width:"string"==typeof l.width?l.width:l.width+"px",height:l.height+"px",lineHeight:l.height+"px",background:l.background,borderRadius:l.circle?l.height/2+"px":l.radius}))),D={background:l.progressBarBg,height:l.height+"px",borderRadius:l.circle?l.height/2+"px 0 0 "+l.height/2+"px":l.radius},S=j((()=>({fontSize:l.textSize}))),U=j((()=>l.value?l.successText:l.text)),F=e=>{l.value||(r.isMoving=!0,u.value.style.transition="none",r.x=(e.pageX||e.touches[0].pageX)-parseInt(u.value.style.left.replace("px",""),10)),s("handlerMove")},H=e=>{if(r.isMoving&&!l.value){const t=m();let a=(e.pageX||e.touches[0].pageX)-r.x;a>0&&a<=t-l.height?(u.value.style.left=a+"px",d.value.style.width=a+l.height/2+"px"):a>t-l.height&&(u.value.style.left=t-l.height+"px",d.value.style.width=t-l.height/2+"px",z())}},R=e=>{if(r.isMoving&&!l.value){const t=m();(e.pageX||e.changedTouches[0].pageX)-r.x<t-l.height?(r.isOk=!0,u.value.style.left="0",u.value.style.transition="all 0.2s",d.value.style.width="0",r.isOk=!1):(u.value.style.transition="none",u.value.style.left=t-l.height+"px",d.value.style.width=t-l.height/2+"px",z()),r.isMoving=!1}},z=()=>{s("update:value",!0),r.isMoving=!1,d.value.style.background=l.completedBg,n.value.style["-webkit-text-fill-color"]="unset",n.value.style.animation="slidetounlock2 2s cubic-bezier(0, 0.2, 1, 1) infinite",n.value.style.color="#fff",s("passCallback")};return t({reset:()=>{u.value.style.left="0",d.value.style.width="0",u.value.children[0].innerHTML=l.handlerIcon,n.value.style["-webkit-text-fill-color"]="transparent",n.value.style.animation="slidetounlock 2s cubic-bezier(0, 0.2, 1, 1) infinite",n.value.style.color=l.background,s("update:value",!1),r.isOk=!1,r.isMoving=!1,r.x=0}}),(e,t)=>(P(),B("div",{ref_key:"dragVerify",ref:i,class:"drag_verify",style:L($(x)),onMousemove:H,onMouseup:R,onMouseleave:R,onTouchmove:H,onTouchend:R},[O("div",{class:I(["dv_progress_bar",{goFirst2:$(o)}]),ref_key:"progressBar",ref:d,style:D},null,2),O("div",{class:"dv_text",style:L($(S)),ref_key:"messageRef",ref:n},[e.$slots.textBefore?V(e.$slots,"textBefore",{key:0},void 0,!0):C("",!0),E(" "+X($(U))+" ",1),e.$slots.textAfter?V(e.$slots,"textAfter",{key:1},void 0,!0):C("",!0)],4),O("div",{class:I(["dv_handler dv_handler_bg",{goFirst:$(o)}]),onMousedown:F,onTouchstart:F,ref_key:"handler",ref:u,style:y},[O("i",{class:"iconfont-sys",innerHTML:e.value?e.successIcon:e.handlerIcon},null,8,ne)],34)],36))}})),[["__scopeId","data-v-293ffbae"]]),de={class:"login"},ce={class:"right-wrap"},pe={class:"top-right-wrap"},ge={class:"iconfont-sys"},ve={class:"menu-txt"},he={key:0,class:"iconfont-sys icon-check"},fe={class:"header"},me={class:"login-wrap"},ye={class:"form"},xe={class:"title"},be={class:"sub-title"},we={class:"drag-verify"},ke={class:"forget-password"},_e={style:{"margin-top":"30px"}},Me=re(x(n(i({},{name:"Login"}),{__name:"index",setup(e){const{t:t}=u(),a=d(),{isDark:s}=D(a),l=k(),r=c(),o=S(),i=k(!1),n=k(!1),x=p.systemInfo.name,w=k(),_=b({username:"",password:"",rememberPassword:!0}),M=j((()=>({username:[{required:!0,message:t("login.placeholder[0]"),trigger:"blur"}],password:[{required:!0,message:t("login.placeholder[1]"),trigger:"blur"}]}))),T=k(!1),L=()=>{return e=this,t=null,a=function*(){if(w.value)try{if(!(yield w.value.validate()))return;if(!i.value)return void(n.value=!0);T.value=!0;const{username:e,password:t}=_,{token:a,refreshToken:s}=yield m.login({username:e,password:t});if(!a)throw new Error("Login failed - no token received");r.setToken(a,s);const l=yield m.getUserInfo();r.setUserInfo(l),r.setLoginStatus(!0),re(),yield o.push("/")}catch(e){e instanceof y||se.error("登录失败,请稍后重试")}finally{T.value=!1,V()}},new Promise(((s,l)=>{var r=e=>{try{i(a.next(e))}catch(t){l(t)}},o=e=>{try{i(a.throw(e))}catch(t){l(t)}},i=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,o);i((a=a.apply(e,t)).next())}));var e,t,a},V=()=>{l.value.reset()},re=()=>{setTimeout((()=>{le({title:t("login.success.title"),type:"success",duration:2500,zIndex:1e4,message:`${t("login.success.message")}, ${r.info.username}!`})}),150)},{locale:ne}=u(),Me=e=>{ne.value!==e&&(ne.value=e,r.setLanguage(e))};return(e,t)=>{const a=ie,r=q,o=z,u=G,d=oe,c=N,p=K,m=ue,y=J,b=U("RouterLink"),k=ee,j=ae,V=F("ripple");return P(),B("div",de,[H(a),O("div",ce,[O("div",pe,[O("div",{class:"btn theme-btn",onClick:t[0]||(t[0]=(...e)=>$(g)&&$(g)(...e))},[O("i",ge,X($(s)?"":""),1)]),H(u,{onCommand:Me,"popper-class":"langDropDownStyle"},{dropdown:R((()=>[H(o,null,{default:R((()=>[(P(!0),B(A,null,Y($(v),(e=>(P(),B("div",{key:e.value,class:"lang-btn-item"},[H(r,{command:e.value,class:I({"is-selected":$(ne)===e.value})},{default:R((()=>[O("span",ve,X(e.label),1),$(ne)===e.value?(P(),B("i",he,"")):C("",!0)])),_:2},1032,["command","class"])])))),128))])),_:1})])),default:R((()=>[t[5]||(t[5]=O("div",{class:"btn language-btn"},[O("i",{class:"iconfont-sys icon-language"},"")],-1))])),_:1,__:[5]})]),O("div",fe,[H(d,{class:"icon"}),O("h1",null,X($(x)),1)]),O("div",me,[O("div",ye,[O("h3",xe,X(e.$t("login.title")),1),O("p",be,X(e.$t("login.subTitle")),1),H(j,{ref_key:"formRef",ref:w,model:$(_),rules:$(M),onKeyup:te(L,["enter"]),style:{"margin-top":"25px"}},{default:R((()=>[H(p,{prop:"username"},{default:R((()=>[H(c,{placeholder:e.$t("login.placeholder[0]"),modelValue:$(_).username,"onUpdate:modelValue":t[1]||(t[1]=e=>$(_).username=e),modelModifiers:{trim:!0}},null,8,["placeholder","modelValue"])])),_:1}),H(p,{prop:"password"},{default:R((()=>[H(c,{placeholder:e.$t("login.placeholder[1]"),modelValue:$(_).password,"onUpdate:modelValue":t[2]||(t[2]=e=>$(_).password=e),modelModifiers:{trim:!0},type:"password",radius:"8px",autocomplete:"off","show-password":""},null,8,["placeholder","modelValue"])])),_:1}),O("div",we,[O("div",{class:I(["drag-verify-content",{error:!$(i)&&$(n)}])},[H(m,{ref_key:"dragVerify",ref:l,value:$(i),"onUpdate:value":t[3]||(t[3]=e=>W(i)?i.value=e:null),text:e.$t("login.sliderText"),textColor:"var(--art-gray-800)",successText:e.$t("login.sliderSuccessText"),progressBarBg:$(h)("--el-color-primary"),background:"var(--art-gray-200)",handlerBg:"var(--art-main-bg-color)"},null,8,["value","text","successText","progressBarBg"])],2),O("p",{class:I(["error-text",{"show-error-text":!$(i)&&$(n)}])},X(e.$t("login.placeholder[2]")),3)]),O("div",ke,[H(y,{modelValue:$(_).rememberPassword,"onUpdate:modelValue":t[4]||(t[4]=e=>$(_).rememberPassword=e)},{default:R((()=>[E(X(e.$t("login.rememberPwd")),1)])),_:1},8,["modelValue"]),H(b,{to:$(f).ForgetPassword},{default:R((()=>[E(X(e.$t("login.forgetPwd")),1)])),_:1},8,["to"])]),O("div",_e,[Q((P(),Z(k,{class:"login-btn",type:"primary",onClick:L,loading:$(T)},{default:R((()=>[E(X(e.$t("login.btnText")),1)])),_:1},8,["loading"])),[[V]])])])),_:1},8,["model","rules"])])])])])}}})),[["__scopeId","data-v-ed1f37eb"]]);export{Me as default};
|