var y=(h,m,i)=>new Promise((d,r)=>{var l=t=>{try{o(i.next(t))}catch(u){r(u)}},v=t=>{try{o(i.throw(t))}catch(u){r(u)}},o=t=>t.done?d(t.value):Promise.resolve(t.value).then(l,v);o((i=i.apply(h,m)).next())});import{l as B,m as M,g as L,q,G as A,o as f,c as g,a,B as w,f as D,s as x,H as I,I as N,t as _,j as b,u as R,d as n,J as U}from"./index-1786807848259.js";import{_ as $}from"./_plugin-vue_export-helper-c27b6911-1786807848259.js";const E={class:"login-screen"},K={class:"login-shell"},T={class:"login-field"},j=["disabled"],F={class:"login-field login-password-field"},G={class:"login-password-control"},H=["disabled","type"],J=["aria-label","aria-pressed"],O={key:0,class:"login-field-assist","aria-live":"polite"},P={key:1,class:"login-error",role:"alert"},W={key:2,class:"login-error",role:"status"},z=["disabled"],Q={__name:"index",setup(h){const m=B(),i=M(),d=n(""),r=n(""),l=n(!1),v=n(!1),o=n(!1),t=n(""),u=n(!1),c=n(!1),C=L(()=>{const s=typeof m.query.redirect=="string"?decodeURIComponent(m.query.redirect):"/platform";return s.startsWith("/login")?"/platform":s||"/platform"});function S(){return y(this,null,function*(){if(t.value="",!d.value||!r.value){t.value="请输入账号和密码。";return}o.value=!0;try{yield U(d.value,r.value),i.replace(C.value)}catch(s){t.value=V(s)}finally{o.value=!1}})}q(()=>y(this,null,function*(){try{const s=yield A();c.value=s.loginAvailable===!0}catch(s){t.value="认证状态暂时无法确认,请稍后重试。"}finally{u.value=!0}}));function k(s){var e;v.value=!!((e=s==null?void 0:s.getModifierState)!=null&&e.call(s,"CapsLock"))}function V(s){const e=String((s==null?void 0:s.message)||"").trim();return/401|403|账号|密码|unauthor/i.test(e)?"账号或密码不正确,请核对后重试。":/network|fetch|timeout|连接|服务|502|503|504/i.test(e)?"登录服务暂时无法连接,请稍后重试。":"暂时无法登录,请稍后重试。"}return(s,e)=>(f(),g("div",E,[a("div",K,[e[9]||(e[9]=a("section",{class:"login-brand","aria-label":"红原县数字畜牧业监管平台"},[a("div",{class:"login-brand-rule","aria-hidden":"true"},[a("i"),a("span"),a("i")]),a("h1",null,[w("红原县数字畜牧业"),a("br"),w("监管平台")]),a("div",{class:"login-brand-glow","aria-hidden":"true"})],-1)),a("form",{class:"login-panel","aria-label":"平台用户登录",onSubmit:D(S,["prevent"])},[e[8]||(e[8]=a("header",{class:"login-panel-head"},[a("div",{class:"login-panel-title"},"用户登录"),a("span",{"aria-hidden":"true"})],-1)),a("label",T,[e[5]||(e[5]=a("span",null,"账号",-1)),x(a("input",{"onUpdate:modelValue":e[0]||(e[0]=p=>d.value=p),disabled:!c.value,autocomplete:"username",autofocus:"",placeholder:"请输入平台账号"},null,8,j),[[I,d.value,void 0,{trim:!0}]])]),a("label",F,[e[6]||(e[6]=a("span",null,"密码",-1)),a("span",G,[x(a("input",{"onUpdate:modelValue":e[1]||(e[1]=p=>r.value=p),disabled:!c.value,autocomplete:"current-password",placeholder:"请输入密码",type:l.value?"text":"password",onKeydown:k,onKeyup:k,onBlur:e[2]||(e[2]=p=>v.value=!1)},null,40,H),[[N,r.value]]),a("button",{class:"login-password-toggle",type:"button","aria-label":l.value?"隐藏密码":"显示密码","aria-pressed":l.value,onClick:e[3]||(e[3]=p=>l.value=!l.value)},_(l.value?"隐藏":"显示"),9,J)])]),v.value?(f(),g("div",O,[...e[7]||(e[7]=[a("span",{class:"login-caps-lock"},"大写锁定已开启",-1)])])):b("",!0),t.value?(f(),g("div",P,_(t.value),1)):b("",!0),u.value&&!c.value?(f(),g("div",W," V3 认证数据尚未初始化,当前仅可使用本机迁移检查入口。 ")):b("",!0),a("button",{class:"login-submit",disabled:o.value||!c.value,type:"submit"},_(o.value?"登录中":"登录"),9,z),u.value&&!c.value?(f(),g("button",{key:3,class:"login-secondary",type:"button",onClick:e[4]||(e[4]=p=>R(i).replace("/v3-isolation"))}," 返回隔离检查 ")):b("",!0)],32)])]))}},ee=$(Q,[["__scopeId","data-v-629c854a"]]);export{ee as default};