import{o as M,c as m,av as _,a7 as W,w as x,x as Y,d as O,z as k,l as s,_ as K,aw as a1,n as l1,au as S,W as H,ax as t1,r as z,h as u,G as I,I as h1,a as E,j as p,C as r,J as A,M as U,ay as f1,F as e1,ab as c1,ap as i1,a3 as p1,az as N}from"./index.js";import{M as L}from"./motion.73bac73d.js";import{R as r1}from"./rule.f4b678e0.js";var s1="/assets/bg.7b14eacd.png";const d1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 998.282 772.773"};function o1(t,a){return M(),m("svg",d1,a[0]||(a[0]=[_('',79)]))}var n1={render:o1};const Z1={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"};function M1(t,a){return M(),m("svg",Z1,a[0]||(a[0]=[_('',74)]))}var u1={render:M1};const v1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 896 529.113"};function m1(t,a){return M(),m("svg",v1,a[0]||(a[0]=[_('',13)]))}var y1={render:m1};const x1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 776.363 516.128"};function g1(t,a){return M(),m("svg",x1,a[0]||(a[0]=[_('',28)]))}var w1={render:g1};const _1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 871 477"};function b1(t,a){return M(),m("svg",_1,a[0]||(a[0]=[_('',34)]))}var j={render:b1};const z1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 712.046 380.322"};function C1(t,a){return M(),m("svg",z1,a[0]||(a[0]=[_('',111)]))}var V1={render:C1};const B1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 1080 589.339"};function F1(t,a){return M(),m("svg",B1,a[0]||(a[0]=[_('',32)]))}var E1={render:F1};const L1=W(()=>{switch(String(new Date().getDay())){case"0":return n1;case"1":return u1;case"2":return y1;case"3":return w1;case"4":return j;case"5":return V1;case"6":return E1;default:return j}}),k1=(t=120,a=40)=>{const e=x(),h=x(""),n=x(0);function f(d){h.value=d}function Z(){if(!e.value)return;const d=$1(e.value,t,a);n.value=d.password,h.value=d.imgCode}return Y(()=>{Z()}),{domRef:e,imgCode:h,password:n,setImgCode:f,getImgCode:Z}};function q(t,a){return Math.floor(Math.random()*(a-t)+t)}function P(){return Math.floor(Math.random()*4)+1}function J(){var t=P(),a=P(),e="+",h;switch(e){case"+":h=t+a;break;case"-":h=t-a;break;case"*":h=t*a;break}return Number(h)<0?J():{subject:`${t}${e}${a}`.trim(),answer:h}}function T(t,a){const e=q(t,a),h=q(t,a),n=q(t,a);return`rgb(${e},${h},${n})`}const q1={"+":"\u52A0","-":"\u51CF","\xD7":"\u4E58"};function $1(t,a,e){let h="",n=0;const f=t.getContext("2d");if(!f)return{imgCode:h,password:0};f.fillStyle=T(180,230),f.fillRect(0,0,a,e);const Z=J();n=Z.answer;for(let d=0;dh.code,v=>{b(v)}),k(Z,v=>{n("update:code",v)}),k(d,v=>{n("update:password",v)}),a({getImgCode:g}),(v,$)=>(M(),m("canvas",{ref_key:"domRef",ref:f,width:"120",height:"40",class:"cursor-pointer",onClick:$[0]||($[0]=(...o)=>s(g)&&s(g)(...o))},null,512))}});var I1=K(S1,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/components/ReImageVerify/src/index.vue"]]);const A1=a1(I1);var U1="/assets/logo.6f5be7a3.png";const D1=["src"],G1={class:"login-container"},H1={class:"img"},N1={class:"login-box"},j1={class:"login-form"},P1={class:"flex w-full items-center justify-center"},T1=["src"],W1={class:"w-full h-20px flex justify-between items-center"},O1={class:"w-full flex justify-center"},K1={name:"Login"},J1=O({...K1,setup(t){const a=x(""),e=l1(),h=x(!1),n=x(!1),f=x(),Z=x(""),d=W(()=>S().currentPage),{loginByUsername:b}=S(),{VITE_IS_PROD:g,WECHAT_URL:v,BACK_URL:$}=c1(),o=H({username:"",password:"",verifyCode:""}),D=async y=>{h.value=!0,y&&await y.validate(async(l,c)=>{if(l)b(o).then(async w=>{const{code:C,message:V,data:B}=w;if(C===0){const{userinfo:F,token:i}=B!=null?B:{},{nickname:R}=F!=null?F:{};i1.setItem("info",{username:R!=null?R:"",accessToken:i!=null?i:""}),p1().then(G=>{N.success("\u767B\u5F55\u6210\u529F"),e.push("/")}).catch(G=>{G===1e4&&e.push("/welcome?error=roleExcption")})}else C>100&&C<200?h.value=!1:(h.value=!1,N.error(V!=null?V:""))});else return h.value=!1,c})},Q=H({username:[{validator(y,l,c){l?t1(l)?c():c(new Error("\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E")):c(new Error("\u8BF7\u8F93\u5165\u624B\u673A\u53F7"))},trigger:"blur"}],password:[{validator:(y,l,c)=>{l===""?c(new Error("\u8BF7\u8F93\u5165\u5BC6\u7801")):r1.test(l)?c():c(new Error("\u5BC6\u7801\u683C\u5F0F\u5E94\u4E3A6-18\u4F4D\u6570\u5B57\u3001\u5B57\u6BCD\u7684\u7EC4\u5408"))},trigger:"blur"}],verifyCode:[{validator:(y,l,c)=>{l===""?c(new Error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):String(Z.value)!==String(l)?c(new Error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801")):c()},trigger:"blur"}]});function X(){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(a,y=>{S().SET_VERIFYCODE(y)}),k(o,()=>{o.username.length>11&&(o.username=o.username.slice(0,11))}),(y,l)=>{const c=z("el-input"),w=z("el-form-item"),C=z("el-checkbox"),V=z("el-button"),B=z("ElButton"),F=z("el-form");return M(),m(e1,null,[u("img",{src:s(s1),class:"wave"},null,8,D1),u("div",G1,[u("div",H1,[(M(),I(h1(s(L1))))]),u("div",N1,[u("div",j1,[E(' '),u("div",P1,[u("img",{src:s(U1),style:{height:"100px"}},null,8,T1)]),p(s(L),null,{default:r(()=>[E(" {{ title }} "),l[8]||(l[8]=u("h2",null,"\u7968\u52A1\u7CFB\u7EDF",-1))]),_:1}),d.value===0?(M(),I(F,{key:0,ref_key:"ruleFormRef",ref:f,model:o,rules:Q,size:"large",onKeyup:l[7]||(l[7]=f1(i=>D(f.value),["enter"]))},{default:r(()=>[p(s(L),{delay:100},{default:r(()=>[p(w,{prop:"username"},{default:r(()=>[p(c,{clearable:"",modelValue:o.username,"onUpdate:modelValue":l[0]||(l[0]=i=>o.username=i),placeholder:"\u8D26\u53F7","prefix-icon":s(A)("user")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(s(L),{delay:150},{default:r(()=>[p(w,{prop:"password"},{default:r(()=>[p(c,{clearable:"","show-password":"",modelValue:o.password,"onUpdate:modelValue":l[1]||(l[1]=i=>o.password=i),placeholder:"\u5BC6\u7801","prefix-icon":s(A)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(s(L),{delay:200},{default:r(()=>[p(w,{prop:"verifyCode"},{default:r(()=>[p(c,{clearable:"",modelValue:o.verifyCode,"onUpdate:modelValue":l[4]||(l[4]=i=>o.verifyCode=i),placeholder:"\u9A8C\u8BC1\u7801","prefix-icon":s(A)("ri:shield-keyhole-line",{online:!0})},{append:r(()=>[p(s(A1),{code:a.value,"onUpdate:code":l[2]||(l[2]=i=>a.value=i),password:Z.value,"onUpdate:password":l[3]||(l[3]=i=>Z.value=i)},null,8,["code","password"])]),_:1},8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(s(L),{delay:250},{default:r(()=>[p(w,null,{default:r(()=>[u("div",W1,[p(C,{modelValue:n.value,"onUpdate:modelValue":l[5]||(l[5]=i=>n.value=i)},{default:r(()=>l[9]||(l[9]=[U("\u8BB0\u4F4F\u5BC6\u7801")])),_:1},8,["modelValue"])]),p(V,{class:"w-full mt-4",size:"default",type:"primary",loading:h.value,onClick:l[6]||(l[6]=i=>D(f.value))},{default:r(()=>l[10]||(l[10]=[U(" \u767B\u5F55 ")])),_:1},8,["loading"])]),_:1}),s(g)?(M(),I(w,{key:0},{default:r(()=>[u("div",O1,[p(B,{link:"",onClick:X},{default:r(()=>l[11]||(l[11]=[U("\u4EACICP\u59072022033072\u53F7-1")])),_:1})])]),_:1})):E("v-if",!0)]),_:1}),E(` \r \r \r \r {{ item.title }}\r \r \r \r `)]),_:1},8,["model","rules"])):E("v-if",!0)])])])],64)}}});var t2=K(J1,[["__scopeId","data-v-37dfd6fc"],["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/login/index.vue"]]);export{t2 as default};