import{r as e,o as a,c as l,w as t,s,i as o,a as n,b as u,u as d,k as r,I as i,C as c,D as m,E as f}from"./index-115eb096.js";import{_ as g,a as p,l as _}from"./index.4540eefd.js";const v=g({__name:"login",setup(g){let v=e(!1);const h=e=>{console.log(e.detail.value[0]),"mianmi"==e.detail.value[0]&&(v.value=!0)};let k=e(""),x=e("");const I=(e="")=>{_({username:k.value,password:x.value}).then((a=>{console.log(a),"ok"==a.status&&(1==v.value&&"click"==e&&(localStorage.setItem("username",k.value),localStorage.setItem("password",x.value),localStorage.setItem("mianmi_date",w())),sessionStorage.setItem("access_token",a.token),sessionStorage.setItem("refresh_token",a.refresh_token),s({url:"/pages/index/index"}))}))},w=()=>(new Date).getTime()+6048e5;return p((()=>{const e=(new Date).getTime();localStorage.getItem("mianmi_date")>e&&(k.value=localStorage.getItem("username"),x.value=localStorage.getItem("password"),I())})),(e,s)=>{const g=o,p=i,_=c,v=m,w=f;return a(),l(g,{class:"login"},{default:t((()=>[n(g,{class:"welcome"},{default:t((()=>[n(g,{style:{"font-size":"50rpx","font-weight":"700","margin-bottom":"20rpx"}},{default:t((()=>[u(" Hello! ")])),_:1}),n(g,{style:{"font-size":"40rpx"}},{default:t((()=>[u(" 欢迎使用会员管理平台 ")])),_:1})])),_:1}),n(g,{class:"login_k"},{default:t((()=>[n(g,{class:"title"},{default:t((()=>[u("用户名")])),_:1}),n(p,{class:"input",modelValue:d(k),"onUpdate:modelValue":s[0]||(s[0]=e=>r(k)?k.value=e:k=e),"placeholder-style":"color:#d7fffd;",placeholder:"请输入用户名"},null,8,["modelValue"]),n(g,{class:"title"},{default:t((()=>[u("密码")])),_:1}),n(p,{class:"input",modelValue:d(x),"onUpdate:modelValue":s[1]||(s[1]=e=>r(x)?x.value=e:x=e),password:"","placeholder-style":"color:#d7fffd;",placeholder:"请输入密码"},null,8,["modelValue"]),n(g,null,{default:t((()=>[n(w,{onChange:h},{default:t((()=>[n(v,null,{default:t((()=>[n(_,{value:"mianmi"}),u("7天免密登录 ")])),_:1})])),_:1})])),_:1})])),_:1}),n(g,{style:{"padding-left":"40rpx","padding-right":"40rpx"}},{default:t((()=>[n(g,{class:"button",onClick:s[2]||(s[2]=e=>I("click"))},{default:t((()=>[u("登 录")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-43877268"]]);export{v as default};
