import{_ as e,o as a,d as s,e as l,f as t,t as n,g as i,u as o,a as r,b as _,E as d,r as c,c as u,h as m,w as g,y as p,s as f,q as v,j as h,p as x,k as b}from"./daotianAdmin-20240327_164749.js";import{_ as y}from"./daotianAdmin-20240327_16474912.js";import{l as w,i as k,a as I}from"./daotianAdmin-20240327_16474916.js";const A={class:""},j={class:"timebox"},q=e({__name:"timmer",props:{timedata:{type:Object,default:()=>({isfinish:!0,deadline:60,timer:null})}},setup(e){const i=e;a((()=>{o()}));const o=()=>{i.timedata.timer=setInterval((()=>{i.timedata.deadline--,i.timedata.deadline<=0&&(i.timedata.deadline=60,i.timedata.isfinish=!0,clearInterval(i.timedata.timer))}),1e3)};return(a,i)=>(s(),l("div",A,[t("span",j,n(e.timedata.deadline)+"秒",1)]))}},[["__scopeId","data-v-0f368491"]]),z=e=>(x("data-v-eae380da"),e=e(),b(),e),F={class:"login-container"},M={class:"centerbox"},O=z((()=>t("div",{class:"contentleft"},null,-1))),U={class:"contentright"},C={class:"contentbox"},D=z((()=>t("div",{class:"g_text_c g_mt_40"},[t("img",{src:"https://matripe-cms.oss-cn-beijing.aliyuncs.com/ibocai/maitianLogo.png",style:{width:"48px","text-align":"center"},alt:""})],-1))),L=z((()=>t("ul",{class:"loginchange centerall g_flex_row_center g_mt_30 g_mb_24"},null,-1))),N={key:0},S=z((()=>t("i",{class:"iconfont icon-yonghuming g_lh_1 g_fsi_22"},null,-1))),T=z((()=>t("i",{class:"iconfont icon-mima g_lh_1 g_fsi_24"},null,-1))),P={key:1,class:"g_mb_51"},E=z((()=>t("i",{class:"iconfont icon-yonghuming g_lh_1 g_fsi_22"},null,-1))),G=z((()=>t("i",{class:"iconfont icon-duanxinyanzheng g_fsi_24"},null,-1))),R={class:"getrulecode"},V={class:"g_text_c g_mt_8"},Y=e({__name:"login",setup(e){i().appContext.app.config.globalProperties.G;const n=o();r(),_(),d((()=>{})),a((()=>{}));const x=c({isfinish:!0,deadline:60,timer:null}),b=c(1),A=c({username:"bocai",password:"123456",code:""}),j=c(),z=e=>{},Y=e=>{w({password:A.value.password,username:A.value.username}).then((e=>{localStorage.setItem("DAOTIAN_token",e.data.token)})).then((()=>{k().then((e=>{localStorage.setItem("DAOTIAN_userinfo_name",e.data.name||e.data.name),localStorage.setItem("DAOTIAN_userinfo_avatar",e.data.avatar),n.push("/merchantManagement/homePage"),p.success("登录成功")}))}))},B=e=>{},H=()=>{""!=A.value.tel&&(x.value.isfinish=!1,I({tel:A.value.tel}).then((e=>{p.success("验证码发送成功")})))};return(e,a)=>{const n=u("a-input"),i=u("a-form-item"),o=u("a-button"),r=u("a-form");return s(),l("div",F,[t("div",M,[O,t("div",U,[t("div",C,[D,L,m(r,{model:A.value,onFinish:Y,onValidate:z,hideRequiredMark:"",colon:!1,onFinishFailed:B,"label-col":{span:2},"wrapper-col":{span:20},autocomplete:"off",ref_key:"loginInfoForm",ref:j,style:""},{default:g((()=>[1==b.value?(s(),l("div",N,[m(i,{class:"",label:" ",name:"username",rules:[{required:!0,message:"请输入手机号"}]},{default:g((()=>[m(n,{value:A.value.username,"onUpdate:value":a[0]||(a[0]=e=>A.value.username=e),size:"large",class:"g_fs_14 g_h_36",maxLength:11,placeholder:"请输入手机号"},{prefix:g((()=>[S])),_:1},8,["value"])])),_:1}),m(i,{class:"",label:" ",name:"password",rules:[{required:!0,message:"请输入密码"}]},{default:g((()=>[m(n,{value:A.value.password,"onUpdate:value":a[1]||(a[1]=e=>A.value.password=e),type:"password",size:"large",class:"g_fs_14 g_h_36",placeholder:"请输入密码"},{prefix:g((()=>[T])),_:1},8,["value"])])),_:1}),t("div",{onClick:a[2]||(a[2]=(...a)=>e.showModal&&e.showModal(...a)),class:"g_fs_12 g_text_r g_pr_24 g_cursor_point",style:{transform:"translateY(-16px)"}}," ")])):(s(),l("div",P,[m(i,{class:"",label:" ",name:"tel",rules:[{required:!0,message:"请输入手机号"}]},{default:g((()=>[m(n,{value:A.value.tel,"onUpdate:value":a[3]||(a[3]=e=>A.value.tel=e),size:"large",class:"g_fs_14 g_h_36",maxLength:11,placeholder:"请输入手机号"},{prefix:g((()=>[E])),_:1},8,["value"])])),_:1}),m(i,{name:"code",label:" ",rules:[{required:!0,message:"请输入验证码"}]},{default:g((()=>[m(n,{type:"text",value:A.value.code,"onUpdate:value":a[4]||(a[4]=e=>A.value.code=e),size:"large",class:"g_fs_14 g_h_36",placeholder:"请输入验证码"},{prefix:g((()=>[G])),suffix:g((()=>[t("div",R,[x.value.isfinish?(s(),l("span",{key:0,onClick:H,class:"g_fs_12 g_pl_6 g_cursor_point"},"获取验证码")):f("",!0),x.value.isfinish?f("",!0):(s(),v(q,{key:1,timedata:x.value},null,8,["timedata"]))])])),_:1},8,["value"])])),_:1})])),t("div",V,[m(o,{type:"primary","html-type":"submit",class:"login-form-button g_h_36 g_br_20 g_w_240"},{default:g((()=>[h("登录")])),_:1})])])),_:1},8,["model"])])])]),m(y,{class:"footer"})])}}},[["__scopeId","data-v-eae380da"]]);export{Y as default};
