import{u as e,r as s,w as a,s as l,E as o,o as t,b as n,c as i,d as u,k as r,h as d,e as c,j as p,am as m,C as v,t as g,i as h,B as w,al as f,m as _,T as k,V as x,W as b,K as y,O as C,P as L,N as V,g as j,ab as E,an as P}from"./index.1712150016841.js";const S={class:"userLogin"},B={key:0,class:"loginPage"},O={class:"loginCard"},U={class:"rightLogin"},I={class:"text-lg font-bold mb-6 flex items-center"},T={key:0,class:"mt-3 login"},A={class:"input_div"},K=c("div",{class:"input_title"}," 邮箱账号 ",-1),D=c("div",{class:"input_title mt-3"}," 登录密码 ",-1),R=["onKeyup"],M={class:"flex mt-4"},z=c("hr",{class:"mt-6 mb-6 hr-login"},null,-1),G={class:"flex"},F={key:1,class:"mt-3 register"},H={class:"input_div"},N=c("div",{class:"input_title"}," 邮箱账号 ",-1),W=c("div",{class:"input_title mt-3"}," 注册密码 ",-1),q=["onKeyup"],J=c("div",{class:"input_title mt-3"}," 验证码 ",-1),Q={class:"flex gap-4"},X={key:1,class:"SmsCodeButton"},Y={class:"flex mt-4"},Z=c("hr",{class:"mt-6 mb-6 hr-login"},null,-1),$={class:"flex"},ee={key:2,class:"mt-3 register"},se={class:"input_div"},ae=c("div",{class:"input_title"}," 邮箱账号 ",-1),le=c("div",{class:"input_title mt-3"}," 新密码 ",-1),oe=c("div",{class:"input_title mt-3"}," 邮件验证码 ",-1),te={class:"flex gap-4"},ne={key:1,class:"SmsCodeButton"},ie={class:"flex mt-4"},ue=c("hr",{class:"mt-6 mb-6 hr-login"},null,-1),re={class:"flex"},de={__name:"userLogin",setup(C){e();const L=s(1),V=s(60),j=s(!1);a(j,(e=>{document.body.style.overflow=e?"hidden":"scroll"}));const E=()=>{j.value=!1},P=l({username:"",password:""}),de=l({username:"",password:"",code:""}),ce=l({username:"",password:"",code:""}),pe=()=>{x({url:"/user/forgetPass",method:"post",data:{username:ce.username,password:ce.password,code:ce.code}}).then((e=>{1===e.code?(P.username=ce.username,P.password=ce.password,b.success("重置成功,已为您自动登录"),ve()):b.error(e.msg)}))},me=()=>{x({url:"/user/register",method:"post",data:{username:de.username,password:de.password,code:de.code}}).then((e=>{1===e.code?(P.username=de.username,P.password=de.password,b.success("从现在起你就是我的主人了,已为您自动登录"),ve()):b.error(e.msg)}))},ve=()=>{x({url:"/user/login",method:"post",data:{username:P.username,password:P.password}}).then((e=>{if(1===e.code){const{user_id:s,token:a}=e.data;y.set("token",a).set("user_id",s),b.success("登录成功! 即将刷新状态"),j.value=!1,setTimeout((()=>{location.reload()}),1e3)}else b.error(e.msg)}))},ge=e=>{x({url:"/api/getMailCode",method:"post",data:{mail:e}}).then((e=>{if(1===e.code){b.success(e.msg);let s=setInterval((()=>{V.value-=1,V.value<=0&&(clearInterval(s),V.value=60)}),1e3)}else b.error(e.msg)}))},he=(e=1)=>{L.value=e,j.value=!0};return o.on("openLogin",he),t((()=>{o.off("openLogin",he)})),(e,s)=>{const a=n("el-icon");return i(),u("div",S,[r(k,{name:"loginFade"},{default:d((()=>[j.value?(i(),u("div",B,[c("div",O,[c("div",U,[r(a,{onClick:E,size:"25px",class:"closeLogin"},{default:d((()=>[r(p(m))])),_:1}),c("h2",I,[c("img",{class:"loginIco",src:"/favicon",alt:""}),v(" "+g(["登录","注册","重置"][L.value-1])+"您的账户 ",1)]),1===L.value?(i(),u("div",T,[c("div",A,[K,h(c("input",{"onUpdate:modelValue":s[0]||(s[0]=e=>P.username=e),class:"inputLogin",placeholder:"请输入邮箱"},null,512),[[w,P.username]]),D,h(c("input",{type:"password","onUpdate:modelValue":s[1]||(s[1]=e=>P.password=e),placeholder:"请输入6-18位密码",class:"inputLogin",onKeyup:f(ve,["enter"])},null,40,R),[[w,P.password]])]),c("div",M,[c("span",{class:"hover text-blue-500 ml-auto text-sm",onClick:s[2]||(s[2]=e=>L.value=3)},"忘记密码?")]),c("div",{class:"mt-4 flex"},[c("button",{class:"loginBtn",onClick:ve}," 登录 ")]),z,c("div",G,[c("div",{class:"text-gray-500 text-sm m-auto cursor-pointer",onClick:s[3]||(s[3]=e=>L.value=2)},"还没有账号?去注册")])])):_("",!0),2===L.value?(i(),u("div",F,[c("div",H,[N,h(c("input",{class:"inputLogin","onUpdate:modelValue":s[4]||(s[4]=e=>de.username=e),placeholder:"请输入邮箱"},null,512),[[w,de.username]]),W,h(c("input",{"onUpdate:modelValue":s[5]||(s[5]=e=>de.password=e),placeholder:"请输入6-18位密码",class:"inputLogin",type:"password",onKeyup:f(ve,["enter"])},null,40,q),[[w,de.password]]),J,c("div",Q,[h(c("input",{type:"number",class:"inputLogin","onUpdate:modelValue":s[6]||(s[6]=e=>de.code=e),placeholder:"请输入验证码"},null,512),[[w,de.code]]),60===V.value?(i(),u("button",{key:0,class:"SmsCodeButton",onClickOnce:s[7]||(s[7]=e=>ge(de.username))},"获取 ",32)):(i(),u("button",X,g(V.value)+"s",1))])]),c("div",Y,[c("span",{class:"hover text-blue-500 ml-auto text-sm",onClick:s[8]||(s[8]=e=>L.value=1)},"已有账号?去登录")]),c("div",{class:"mt-4 flex"},[c("button",{class:"loginBtn",onClick:me}," 提交注册 ")]),Z,c("div",$,[c("div",{class:"text-gray-500 text-sm m-auto cursor-pointer",onClick:s[9]||(s[9]=e=>L.value=3)},"忘记密码?去找回")])])):_("",!0),3===L.value?(i(),u("div",ee,[c("div",se,[ae,h(c("input",{class:"inputLogin","onUpdate:modelValue":s[10]||(s[10]=e=>ce.username=e),placeholder:"请输入邮箱"},null,512),[[w,ce.username]]),le,h(c("input",{"onUpdate:modelValue":s[11]||(s[11]=e=>ce.password=e),placeholder:"请输入6-18位密码",type:"password",class:"inputLogin"},null,512),[[w,ce.password]]),oe,c("div",te,[h(c("input",{type:"number",class:"inputLogin","onUpdate:modelValue":s[12]||(s[12]=e=>ce.code=e),placeholder:"请输入验证码"},null,512),[[w,ce.code]]),60===V.value?(i(),u("button",{key:0,class:"SmsCodeButton",onClickOnce:s[13]||(s[13]=e=>ge(ce.username))},"获取 ",32)):(i(),u("button",ne,g(V.value)+"s",1))])]),c("div",ie,[c("span",{class:"hover text-blue-500 ml-auto text-sm",onClick:s[14]||(s[14]=e=>L.value=1)},"已有账号?去登录")]),c("div",{class:"mt-4 flex"},[c("button",{class:"loginBtn",onClick:pe}," 提交 ")]),ue,c("div",re,[c("div",{class:"text-gray-500 text-sm m-auto cursor-pointer",onClick:s[15]||(s[15]=e=>L.value=2)},"还没有账号?去注册")])])):_("",!0)])])])):_("",!0)])),_:1})])}}},ce={iconGroup:C((()=>L((()=>import("./iconGroup.1712150016841.js")),["assets/iconGroup.1712150016841.js","assets/iconGroup.1712150016841.css","assets/index.1712150016841.js","assets/index.17121500168415.css","assets/jquery.1712150016841.js"]))),addicon:C((()=>L((()=>import("./addicon.1712150016841.js")),["assets/addicon.1712150016841.js","assets/addicon.1712150016841.css","assets/index.1712150016841.js","assets/index.17121500168415.css"]))),addSearchEngine:C((()=>L((()=>import("./addSearchEngine.1712150016841.js")),["assets/addSearchEngine.1712150016841.js","assets/addSearchEngine.1712150016841.css","assets/index.1712150016841.js","assets/index.17121500168415.css","assets/net.1712150016841.js"]))),background:C((()=>L((()=>import("./index.17121500168415.js")),["assets/index.17121500168415.js","assets/index.17121500168412.css","assets/index.1712150016841.js","assets/index.17121500168415.css"])))};const pe={key:0,class:"framer"},me=[c("svg",{width:"24",height:"24",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[c("path",{d:"M8 8L40 40",stroke:"var(--framerSvg)","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),c("path",{d:"M8 40L40 8",stroke:"var(--framerSvg)","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],ve={class:"componentView"},ge={__name:"framer",setup(e){const a=s(!1),l=s({}),m=s(null);let v={width:"1000px",height:"500px",top:"15vh"};const g=s(Object.assign({},v)),h=V(ce.note),w=e=>{const{size:s=!1}=e;if(s){g.value.width=s.width,g.value.height=s.height;const{top:e="15vh"}=s;g.value.top=e}else g.value=Object.assign({},v);P("--frameHeight",g.value.height),h.value=ce[e.component];const{data:o={}}=e;l.value=o,a.value=!0},f=()=>{a.value=!1},k=e=>{a.value=!1,e()};return o.on("openPlugin",w),o.on("closePlugin",f),t((()=>{o.off("openPlugin",w),o.off("closePlugin",f)})),(e,s)=>{const o=n("el-dialog");return a.value?(i(),u("div",pe,[r(o,{modal:!1,modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=e=>a.value=e),"append-to-body":"","show-close":!1,"close-on-click-modal":!1,width:g.value.width,"before-close":k,class:"framerAlert",top:g.value.top,ref_key:"framers",ref:m,draggable:""},{header:d((()=>[c("div",{class:"flex justify-end"},[c("div",{class:"cursor-pointer windowController windowclose",onClick:f,title:"关闭窗口"},me)])])),default:d((()=>[c("div",ve,[(i(),j(E(p(h)),{data:l.value,onClose:f},null,40,["data"]))])])),_:1},8,["modelValue","width","top"])])):_("",!0)}}};const he={class:"appSide"},we={__name:"appSide",setup:s=>(e(),(e,s)=>(i(),u("div",he,[r(de),r(ge)])))};export{we as default};