import{o as M,c as m,aH as w,ah as O,x as _,y as a1,_ as K,d as Q,A as k,m as r,aL as l1,v as t1,p as h1,ad as S,Z as P,aX as c1,r as z,h as v,G as R,I as e1,a as $,l as p,D as s,J as D,M as A,aY as f1,F as i1,ac as p1,az as r1,a5 as s1,aZ as U,Q as d1,R as o1}from"./index.js";import{M as L}from"./motion.6a462330.js";import{R as n1}from"./rule.9287b9d2.js";var Z1="/assets/bg.7b14eacd.png";const M1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 998.282 772.773"},u1=w('',79),v1=[u1];function m1(a,l){return M(),m("svg",M1,v1)}var y1={render:m1};const x1={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 883 711.86"},_1=w('',74),g1=[_1];function w1(a,l){return M(),m("svg",x1,g1)}var b1={render:w1};const z1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 896 529.113"},C1=w('',13),V1=[C1];function B1(a,l){return M(),m("svg",z1,V1)}var F1={render:B1};const E1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 776.363 516.128"},$1=w('',28),L1=[$1];function k1(a,l){return M(),m("svg",E1,L1)}var q1={render:k1};const I1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 871 477"},S1=w('',34),R1=[S1];function D1(a,l){return M(),m("svg",I1,R1)}var j={render:D1};const A1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 712.046 380.322"},U1=w('',111),H1=[U1];function G1(a,l){return M(),m("svg",A1,H1)}var N1={render:G1};const P1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 1080 589.339"},j1=w('',32),T1=[j1];function W1(a,l){return M(),m("svg",P1,T1)}var O1={render:W1};const K1=O(()=>{switch(String(new Date().getDay())){case"0":return y1;case"1":return b1;case"2":return F1;case"3":return q1;case"4":return j;case"5":return N1;case"6":return O1;default:return j}}),Q1=(a=120,l=40)=>{const e=_(),h=_(""),n=_(0);function c(d){h.value=d}function o(){if(!e.value)return;const d=Y1(e.value,a,l);n.value=d.password,h.value=d.imgCode}return a1(()=>{o()}),{domRef:e,imgCode:h,password:n,setImgCode:c,getImgCode:o}};function q(a,l){return Math.floor(Math.random()*(l-a)+a)}function T(){return Math.floor(Math.random()*4)+1}function X(){var a=T(),l=T(),e="+",h;switch(e){case"+":h=a+l;break;case"-":h=a-l;break;case"*":h=a*l;break}return Number(h)<0?X():{subject:`${a}${e}${l}`.trim(),answer:h}}function W(a,l){const e=q(a,l),h=q(a,l),n=q(a,l);return`rgb(${e},${h},${n})`}const X1={"+":"\u52A0","-":"\u51CF","\xD7":"\u4E58"};function Y1(a,l,e){let h="",n=0;const c=a.getContext("2d");if(!c)return{imgCode:h,password:0};c.fillStyle=W(180,230),c.fillRect(0,0,l,e);const o=X();n=o.answer;for(let d=0;dh.code,u=>{d(u)}),k(c,u=>{e("update:code",u)}),k(o,u=>{e("update:password",u)}),l({getImgCode:y}),(u,C)=>(M(),m("canvas",{ref_key:"domRef",ref:n,width:"120",height:"40",class:"cursor-pointer",onClick:C[0]||(C[0]=(...H)=>r(y)&&r(y)(...H))},null,512))}});var l2=K(a2,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/components/ReImageVerify/src/index.vue"]]);const t2=l1(l2);var h2="/assets/logo.6f5be7a3.png";const c2=a=>(d1("data-v-37dfd6fc"),a=a(),o1(),a),e2=["src"],f2={class:"login-container"},i2={class:"img"},p2={class:"login-box"},r2={class:"login-form"},s2={class:"flex w-full items-center justify-center"},d2=["src"],o2=c2(()=>v("h2",null,"\u91C7\u9500365\u7ED3\u7B97",-1)),n2={class:"w-full h-20px flex justify-between items-center"},Z2={class:"w-full flex justify-center"},M2={name:"Login"},u2=Q({...M2,setup(a){var N;(N=t1().appContext.config.globalProperties.$config)==null||N.Title;const l=_(""),e=h1(),h=_(!1),n=_(!1),c=_(),o=_(""),d=O(()=>S().currentPage),{loginByUsername:y}=S(),{VITE_IS_PROD:u,WECHAT_URL:C,BACK_URL:H}=p1(),Z=P({username:"",password:"",verifyCode:""}),G=async x=>{h.value=!0,x&&await x.validate(async(t,f)=>{if(t)y(Z).then(async g=>{const{code:V,message:B,data:F}=g;if(V===0){const{userinfo:E,token:i}=F!=null?F:{},{nickname:I}=E!=null?E:{};r1.setItem("info",{username:I!=null?I:"",accessToken:i!=null?i:""}),s1().then(b=>{!b||(b==null?void 0:b.length)===0?(h.value=!1,U.warning("\u8BE5\u7528\u6237\u5F53\u524D\u516C\u53F8\u65E0\u83DC\u5355\u6743\u9650\uFF01")):(U.success("\u767B\u5F55\u6210\u529F"),e.push("/"))}).catch(b=>{b===1e4&&e.push("/welcome?error=roleExcption")})}else V>100&&V<200?h.value=!1:(h.value=!1,U.error(B!=null?B:""))});else return h.value=!1,f})},Y=P({username:[{validator(x,t,f){t?c1(t)?f():f(new Error("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")):f(new Error("\u8BF7\u8F93\u5165\u624B\u673A\u53F7"))},trigger:"blur"}],password:[{validator:(x,t,f)=>{t===""?f(new Error("\u8BF7\u8F93\u5165\u5BC6\u7801")):n1.test(t)?f():f(new Error("\u5BC6\u7801\u683C\u5F0F\u5E94\u4E3A6-18\u4F4D\u6570\u5B57\u3001\u5B57\u6BCD\u7684\u7EC4\u5408"))},trigger:"blur"}],verifyCode:[{validator:(x,t,f)=>{t===""?f(new Error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):String(o.value)!==String(t)?f(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801")):f()},trigger:"blur"}]});function J(){window.open("https://beian.miit.gov.cn/")}return window.navigator.userAgent.toLowerCase().match(/micromessenger/i)=="micromessenger"&&window.location.search!=="?from=authorization"&&(window.location.href="http://rep.test241.wanyuhengtong.com?back=http://webcx.test241.wanyuhengtong.com&name=\u91C7\u9500\u7ED3\u7B97\u5E73\u53F0"),k(l,x=>{S().SET_VERIFYCODE(x)}),k(Z,()=>{Z.username.length>11&&(Z.username=Z.username.slice(0,11))}),(x,t)=>{const f=z("el-input"),g=z("el-form-item"),V=z("el-checkbox"),B=z("el-button"),F=z("ElButton"),E=z("el-form");return M(),m(i1,null,[v("img",{src:r(Z1),class:"wave"},null,8,e2),v("div",f2,[v("div",i2,[(M(),R(e1(r(K1))))]),v("div",p2,[v("div",r2,[$(' '),v("div",s2,[v("img",{src:r(h2),style:{height:"100px"}},null,8,d2)]),p(r(L),null,{default:s(()=>[$("

{{ title }}

"),o2]),_:1}),r(d)===0?(M(),R(E,{key:0,ref_key:"ruleFormRef",ref:c,model:Z,rules:Y,size:"large",onKeyup:t[7]||(t[7]=f1(i=>G(c.value),["enter"]))},{default:s(()=>[p(r(L),{delay:100},{default:s(()=>[p(g,{prop:"username"},{default:s(()=>[p(f,{clearable:"",modelValue:Z.username,"onUpdate:modelValue":t[0]||(t[0]=i=>Z.username=i),placeholder:"\u8D26\u53F7","prefix-icon":r(D)("user")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(r(L),{delay:150},{default:s(()=>[p(g,{prop:"password"},{default:s(()=>[p(f,{clearable:"","show-password":"",modelValue:Z.password,"onUpdate:modelValue":t[1]||(t[1]=i=>Z.password=i),placeholder:"\u5BC6\u7801","prefix-icon":r(D)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(r(L),{delay:200},{default:s(()=>[p(g,{prop:"verifyCode"},{default:s(()=>[p(f,{clearable:"",modelValue:Z.verifyCode,"onUpdate:modelValue":t[4]||(t[4]=i=>Z.verifyCode=i),placeholder:"\u9A8C\u8BC1\u7801","prefix-icon":r(D)("ri:shield-keyhole-line",{online:!0})},{append:s(()=>[p(r(t2),{code:l.value,"onUpdate:code":t[2]||(t[2]=i=>l.value=i),password:o.value,"onUpdate:password":t[3]||(t[3]=i=>o.value=i)},null,8,["code","password"])]),_:1},8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(r(L),{delay:250},{default:s(()=>[p(g,null,{default:s(()=>[v("div",n2,[p(V,{modelValue:n.value,"onUpdate:modelValue":t[5]||(t[5]=i=>n.value=i)},{default:s(()=>[A("\u8BB0\u4F4F\u5BC6\u7801")]),_:1},8,["modelValue"])]),p(B,{class:"w-full mt-4",size:"default",type:"primary",loading:h.value,onClick:t[6]||(t[6]=i=>G(c.value))},{default:s(()=>[A(" \u767B\u5F55 ")]),_:1},8,["loading"])]),_:1}),r(u)?(M(),R(g,{key:0},{default:s(()=>[v("div",Z2,[p(F,{link:"",onClick:J},{default:s(()=>[A("\u4EACICP\u59072022033072\u53F7-1")]),_:1})])]),_:1})):$("v-if",!0)]),_:1}),$(` \r \r
\r \r {{ item.title }}\r \r
\r
\r
`)]),_:1},8,["model","rules"])):$("v-if",!0)])])])],64)}}});var g2=K(u2,[["__scopeId","data-v-37dfd6fc"],["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/login/index.vue"]]);export{g2 as default};