"use strict";(self.webpackChunkwu_vue_zone_ecology_net=self.webpackChunkwu_vue_zone_ecology_net||[]).push([[96,719],{48218:function(e,a,t){t.r(a),t.d(a,{default:function(){return m}});t(74538);var l=t(67759),i=t(76364),s=t(12257),o=t(95170),d=t(64779),r=t(21615),u=t(81985),n=t(79065);const p={class:"ve_container"};var c={__name:"Login",setup(e){const a={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},t=(0,u.oR)(),c=(0,n.tv)(),m=(0,i.qj)({username:"",password:""}),{username:w,password:_}=(0,i.BK)(m),f=(0,i.iH)(null),h=(0,i.iH)(!1);sessionStorage.clear(),t.dispatch(`app/${o.L4}`,""),c.options.isAddDynamicMenuRoutes=!1;const g=()=>{f.value.validate((async e=>{if(e){const e=await VE_API.system.login(m);if(0===e.code){await t.dispatch(`app/${o.L4}`,e.data),await t.dispatch(`app/${o.Wy}`,e.data.accessToken),await t.dispatch(`app/${o.aR}`,e.data.refreshToken),await t.dispatch(`app/${o.TR}`,m.username);const a=await VE_API.system.resolvingUser({accessToken:e.data.accessToken});console.log(a),a&&a.id&&(await t.dispatch(`app/${o.mg}`,a.id),await t.dispatch(`app/${o.Qi}`,a.id));const{titleCode:l,titleData:i}=await VE_API.configApi.getTitleInfo();0===l&&null!=i&&(!0===i.enabled?(await t.dispatch(`app/${o.Es}`,null==i.wechatVerificationCode?d.wechat_verification_code:i.wechatVerificationCode),await t.dispatch(`app/${o.Hk}`,null==i.wechatKeyWord?d.wechat_key_word:i.wechatKeyWord)):(await t.dispatch(`app/${o.rK}`,!0),await t.dispatch(`app/${o.Es}`,!0))),h.value=!0,c.push({name:"AppMain"})}}}))};return(e,t)=>{const o=(0,l.up)("router-link"),d=(0,l.up)("Avatar"),u=(0,l.up)("el-icon"),n=(0,l.up)("el-input"),c=(0,l.up)("el-form-item"),v=(0,l.up)("Key"),y=(0,l.up)("el-button"),W=(0,l.up)("el-form"),k=(0,l.up)("el-card");return(0,l.wg)(),(0,l.j4)((0,i.SU)(r.default),null,{default:(0,l.w5)((()=>[(0,l._)("div",p,[(0,l.Wm)(k,{"body-style":{background:"rgba(0,0,0,0.15)"}},{default:(0,l.w5)((()=>[(0,l.Wm)(o,{style:{float:"right"},to:{path:"register"}},{default:(0,l.w5)((()=>t[2]||(t[2]=[(0,l.Uk)("注册")]))),_:1}),t[4]||(t[4]=(0,l._)("h1",null,"网络渗透",-1)),(0,l.Wm)(s.uT,{name:"el-fade-in-linear"},{default:(0,l.w5)((()=>[(0,l.wy)((0,l.Wm)(W,{model:m,rules:a,class:"ve_form",ref_key:"ref_form",ref:f,inline:!1,onKeyup:(0,s.D2)(g,["enter"])},{default:(0,l.w5)((()=>[(0,l.Wm)(c,{prop:"username"},{default:(0,l.w5)((()=>[(0,l.Wm)(n,{modelValue:(0,i.SU)(w),"onUpdate:modelValue":t[0]||(t[0]=e=>(0,i.dq)(w)?w.value=e:null),modelModifiers:{trim:!0},placeholder:"用户名"},{prepend:(0,l.w5)((()=>[(0,l.Wm)(u,{size:20},{default:(0,l.w5)((()=>[(0,l.Wm)(d)])),_:1})])),_:1},8,["modelValue"])])),_:1}),(0,l.Wm)(c,{prop:"password"},{default:(0,l.w5)((()=>[(0,l.Wm)(n,{modelValue:(0,i.SU)(_),"onUpdate:modelValue":t[1]||(t[1]=e=>(0,i.dq)(_)?_.value=e:null),modelModifiers:{trim:!0},"show-password":"",placeholder:"密码"},{prepend:(0,l.w5)((()=>[(0,l.Wm)(u,{size:20},{default:(0,l.w5)((()=>[(0,l.Wm)(v)])),_:1})])),_:1},8,["modelValue"])])),_:1}),(0,l.Wm)(c,null,{default:(0,l.w5)((()=>[(0,l.Wm)(y,{class:"ve_submit",type:"primary",onClick:g},{default:(0,l.w5)((()=>t[3]||(t[3]=[(0,l.Uk)(" 登录 ")]))),_:1})])),_:1})])),_:1},8,["model"]),[[s.F8,!h.value]])])),_:1})])),_:1})])])),_:1})}}};var m=(0,t(70636).Z)(c,[["__scopeId","data-v-5e7c18b8"]])}}]);