"use strict";(self.webpackChunkwu_vue_zone_ecology=self.webpackChunkwu_vue_zone_ecology||[]).push([[808,432],{1361:function(e,a,l){l.r(a),l.d(a,{default:function(){return m}});l(44114);var t=l(20641),s=l(50953),r=l(53751),o=l(79515),d=l(83849),u=l(66278),n=l(75220);const i={class:"ve_container"},p=(e=>((0,t.Qi)("data-v-c70b3dce"),e=e(),(0,t.jt)(),e))((()=>(0,t.Lk)("h1",null,"Java 内网穿透",-1)));var c={__name:"Login",setup(e){const a={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},l=(0,u.Pj)(),c=(0,n.rd)(),m=(0,s.Kh)({username:"",password:""}),{username:f,password:_}=(0,s.QW)(m),k=(0,s.KR)(null),b=(0,s.KR)(!1);sessionStorage.clear(),l.dispatch(`app/${o.$T}`,""),c.options.isAddDynamicMenuRoutes=!1;const g=()=>{k.value.validate((async e=>{if(e){const e=await VE_API.system.login(m);if(0===e.code){await l.dispatch(`app/${o.$T}`,e.data),await l.dispatch(`app/${o.w3}`,e.data.accessToken),await l.dispatch(`app/${o.jr}`,e.data.refreshToken),await l.dispatch(`app/${o.Q1}`,m.username);const a=await VE_API.system.resolvingUser({accessToken:e.data.accessToken});console.log(a),a&&a.id&&(await l.dispatch(`app/${o.wC}`,a.id),await l.dispatch(`app/${o.Dl}`,a.id)),b.value=!0,c.push({name:"AppMain"})}}}))};return(e,l)=>{const o=(0,t.g2)("router-link"),u=(0,t.g2)("Avatar"),n=(0,t.g2)("el-icon"),c=(0,t.g2)("el-input"),v=(0,t.g2)("el-form-item"),w=(0,t.g2)("Key"),h=(0,t.g2)("el-button"),y=(0,t.g2)("el-form"),F=(0,t.g2)("el-card");return(0,t.uX)(),(0,t.Wv)((0,s.R1)(d.default),null,{default:(0,t.k6)((()=>[(0,t.Lk)("div",i,[(0,t.bF)(F,{"body-style":{background:"rgba(0,0,0,0.15)"}},{default:(0,t.k6)((()=>[(0,t.bF)(o,{style:{float:"right"},to:{path:"register"}},{default:(0,t.k6)((()=>[(0,t.eW)("注册")])),_:1}),p,(0,t.bF)(r.eB,{name:"el-fade-in-linear"},{default:(0,t.k6)((()=>[(0,t.bo)((0,t.bF)(y,{model:m,rules:a,class:"ve_form",ref_key:"ref_form",ref:k,inline:!1,onKeyup:(0,r.jR)(g,["enter"])},{default:(0,t.k6)((()=>[(0,t.bF)(v,{prop:"username"},{default:(0,t.k6)((()=>[(0,t.bF)(c,{modelValue:(0,s.R1)(f),"onUpdate:modelValue":l[0]||(l[0]=e=>(0,s.i9)(f)?f.value=e:null),modelModifiers:{trim:!0},placeholder:"用户名"},{prepend:(0,t.k6)((()=>[(0,t.bF)(n,{size:20},{default:(0,t.k6)((()=>[(0,t.bF)(u)])),_:1})])),_:1},8,["modelValue"])])),_:1}),(0,t.bF)(v,{prop:"password"},{default:(0,t.k6)((()=>[(0,t.bF)(c,{modelValue:(0,s.R1)(_),"onUpdate:modelValue":l[1]||(l[1]=e=>(0,s.i9)(_)?_.value=e:null),modelModifiers:{trim:!0},"show-password":"",placeholder:"密码"},{prepend:(0,t.k6)((()=>[(0,t.bF)(n,{size:20},{default:(0,t.k6)((()=>[(0,t.bF)(w)])),_:1})])),_:1},8,["modelValue"])])),_:1}),(0,t.bF)(v,null,{default:(0,t.k6)((()=>[(0,t.bF)(h,{class:"ve_submit",type:"primary",onClick:g},{default:(0,t.k6)((()=>[(0,t.eW)(" 登录 ")])),_:1})])),_:1})])),_:1},8,["model"]),[[r.aG,!b.value]])])),_:1})])),_:1})])])),_:1})}}};var m=(0,l(64621).A)(c,[["__scopeId","data-v-c70b3dce"]])}}]);