import{o as M,c as m,av as _,a2 as W,m as x,n as a1,d as O,w as L,h as s,_ as K,aw as l1,j as t1,au as R,Q as N,ax as h1,r as z,e as u,A,C as f1,a as E,f as p,x as r,D as S,H as I,ay as e1,F as c1,a6 as i1,ak as p1,az as U,U as r1}from"./index.js";import{M as k}from"./motion.cd0ccb33.js";import{R as s1}from"./rule.5457d3e8.js";var d1="/assets/bg.7b14eacd.png";const o1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 998.282 772.773"};function n1(t,a){return M(),m("svg",o1,a[0]||(a[0]=[_('',79)]))}var Z1={render:n1};const M1={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 u1(t,a){return M(),m("svg",M1,a[0]||(a[0]=[_('',74)]))}var v1={render:u1};const m1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 896 529.113"};function y1(t,a){return M(),m("svg",m1,a[0]||(a[0]=[_('',13)]))}var x1={render:y1};const g1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 776.363 516.128"};function w1(t,a){return M(),m("svg",g1,a[0]||(a[0]=[_('',28)]))}var _1={render:w1};const b1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 871 477"};function z1(t,a){return M(),m("svg",b1,a[0]||(a[0]=[_('',34)]))}var j={render:z1};const C1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 712.046 380.322"};function V1(t,a){return M(),m("svg",C1,a[0]||(a[0]=[_('',111)]))}var B1={render:V1};const F1={xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:"500",height:"380",viewBox:"0 0 1080 589.339"};function E1(t,a){return M(),m("svg",F1,a[0]||(a[0]=[_('',32)]))}var k1={render:E1};const L1=W(()=>{switch(String(new Date().getDay())){case"0":return Z1;case"1":return v1;case"2":return x1;case"3":return _1;case"4":return j;case"5":return B1;case"6":return k1;default:return j}}),q1=(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=D1(e.value,t,a);n.value=d.password,h.value=d.imgCode}return a1(()=>{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 Q(){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?Q():{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 $1={"+":"\u52A0","-":"\u51CF","\xD7":"\u4E58"};function D1(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=Q();n=Z.answer;for(let d=0;dh.code,v=>{b(v)}),L(Z,v=>{n("update:code",v)}),L(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 S1=K(A1,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/components/ReImageVerify/src/index.vue"]]);const I1=l1(S1);var U1="/assets/logo.6f5be7a3.png";const H1=["src"],G1={class:"login-container"},N1={class:"img"},j1={class:"login-box"},P1={class:"login-form"},T1={class:"flex w-full items-center justify-center"},W1=["src"],O1={class:"w-full h-20px flex justify-between items-center"},K1={class:"w-full flex justify-center"},Q1={name:"Login"},X1=O({...Q1,setup(t){const a=x(""),e=t1(),h=x(!1),n=x(!1),f=x(),Z=x(""),d=W(()=>R().currentPage),{loginByUsername:b}=R(),{VITE_IS_PROD:g,WECHAT_URL:v,BACK_URL:$}=i1(),o=N({username:"",password:"",verifyCode:""}),H=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,role_level:J}=B!=null?B:{},{nickname:D}=F!=null?F:{};if(p1.setItem("info",{username:D!=null?D:"",accessToken:i!=null?i:""}),J==3){h.value=!1,U.warning("\u4F9B\u5E94\u5546\u7AEF\u8D26\u53F7\u4E0D\u80FD\u767B\u5F55\u8BE5\u7CFB\u7EDF");return}r1().then(G=>{U.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,U.error(V!=null?V:""))});else return h.value=!1,c})},X=N({username:[{validator(y,l,c){l?h1(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")):s1.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 Y(){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"),L(a,y=>{R().SET_VERIFYCODE(y)}),L(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(c1,null,[u("img",{src:s(d1),class:"wave"},null,8,H1),u("div",G1,[u("div",N1,[(M(),A(f1(s(L1))))]),u("div",j1,[u("div",P1,[E(' '),u("div",T1,[u("img",{src:s(U1),style:{height:"100px"}},null,8,W1)]),p(s(k),null,{default:r(()=>[E(" {{ title }} "),l[8]||(l[8]=u("h2",null,"\u7968\u52A1\u7CFB\u7EDF",-1))]),_:1}),d.value===0?(M(),A(F,{key:0,ref_key:"ruleFormRef",ref:f,model:o,rules:X,size:"large",onKeyup:l[7]||(l[7]=e1(i=>H(f.value),["enter"]))},{default:r(()=>[p(s(k),{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(S)("user")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(s(k),{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(S)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),p(s(k),{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(S)("ri:shield-keyhole-line",{online:!0})},{append:r(()=>[p(s(I1),{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(k),{delay:250},{default:r(()=>[p(w,null,{default:r(()=>[u("div",O1,[p(C,{modelValue:n.value,"onUpdate:modelValue":l[5]||(l[5]=i=>n.value=i)},{default:r(()=>l[9]||(l[9]=[I("\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=>H(f.value))},{default:r(()=>l[10]||(l[10]=[I(" \u767B\u5F55 ")])),_:1},8,["loading"])]),_:1}),s(g)?(M(),A(w,{key:0},{default:r(()=>[u("div",K1,[p(B,{link:"",onClick:Y},{default:r(()=>l[11]||(l[11]=[I("\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 h2=K(X1,[["__scopeId","data-v-37dfd6fc"],["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/login/index.vue"]]);export{h2 as default};