Index-66d22294.js 2.8 KB

1
  1. import"./index-c185c271.js";import{B as b}from"./index-1e7a1b73.js";import{u as w,C as k}from"./index-f991895b.js";import"./index-e409b0cc.js";import{F as V}from"./index-1bd71d29.js";import{d as C,r as i,o as I,b as S,e as $,f as e,c as n,h as c,u as B,l as z,p as F,j,_ as N}from"./index-e15dd362.js";import{p as P}from"./request-03231080.js";import{F as R}from"./index-d64fbecc.js";import"./use-expose-2b8b5d65.js";const f=l=>(F("data-v-24e23ff4"),l=l(),j(),l),q={style:{height:"100vh",overflow:"hidden",display:"flex","flex-direction":"column"}},L={style:{height:"100%","background-image":"url('static/images/bg-register.png')","background-repeat":"no-repeat","background-position-y":"0px","background-size":"100%"}},M=f(()=>e("div",{style:{padding:"100px 16px 30px 32px",display:"flex","justify-content":"space-between","align-items":"center"}},[e("div",null,[e("div",{style:{color:"#5C677C",height:"30px"}}),e("div",{style:{"font-size":"1.1rem","font-weight":"bold"}},[e("span",null,"忘记密码")]),e("div",{style:{"font-size":"0.9rem",color:"#6D7A90"}},[e("span",null,"请输入手机号和验证码找回密码")])])],-1)),U={style:{"margin-top":"60px"}},A={style:{margin:"16px"}},D=f(()=>e("span",null,"密码已找回?",-1)),E=C({__name:"Index",setup(l){const m=B(),t=w(),_=i(),s=i(""),a=i(""),r=i(!0),v=()=>{m.replace("/login")};I(()=>{console.log("onMounted"),r.value=t.$state.rememberPassword,r.value&&(s.value=t.$state.username,a.value=t.$state.password)});const g=()=>{var p;(p=_.value)==null||p.validate().then(()=>{t.$patch({rememberPassword:r.value}),r.value&&t.$patch({username:s.value,password:a.value}),P("/user/login",{username:s.value,password:a.value}).then(({data:o})=>{console.log(o),o.code==0&&(t.$patch(d=>{d.token=o.data.token}),m.push("/"))})}).catch(o=>{console.log(o)})};return(p,o)=>{const d=V,h=k,x=b,y=R;return S(),$("div",q,[e("div",L,[M,e("div",U,[n(y,{ref_key:"formRef",ref:_,onSubmit:g},{default:c(()=>[n(h,{inset:""},{default:c(()=>[n(d,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=u=>s.value=u),name:"username",label:"账号","label-width":"70",placeholder:"请输入账号",rules:[{required:!0,message:"请填写账号"}]},null,8,["modelValue"]),n(d,{modelValue:a.value,"onUpdate:modelValue":o[1]||(o[1]=u=>a.value=u),name:"password",center:"",clearable:"",label:"密码","label-width":"70",type:"password",placeholder:"请输入密码",rules:[{required:!0,message:"请输入密码"}]},null,8,["modelValue"])]),_:1}),e("div",A,[n(x,{round:"",block:"",type:"primary",size:"large","native-type":"submit"},{default:c(()=>[z("确认")]),_:1})]),e("div",{style:{padding:"0px 16px",display:"flex","justify-content":"space-between"}},[e("div",null,[D,e("a",{onClick:v},"去登录")])])]),_:1},512)])])])}}});const Y=N(E,[["__scopeId","data-v-24e23ff4"]]);export{Y as default};