import{r as h,o as f,c as w,w as l,a as t,b as o,u as s,d as i,v as y,e as r,t as p,f as a,g as x,h as S,s as $}from"./app-DnroACXc.js";import{i as v,c as V}from"./app-DckefXYL.js";/* empty css            */import{_}from"./app-COct4tsy.js";import{_ as u}from"./app-DPkDcD7h.js";import{_ as b}from"./app-MnSDCF4P.js";import{_ as C}from"./app-DIj7zeG-.js";import{D as g}from"./app-Cx7ENVlu.js";import"./app-LqsmzyUT.js";import"./app-CF0qXH5Q.js";import"./app-CYYQ_Zep.js";import"./app-Cmxxk_WX.js";import"./app-CF8nmC-F.js";import"./app-B09rlSqG.js";import"./app-CZGZgDLc.js";import"./app-BHSilYuu.js";import"./app-BQ_EeKjW.js";function k(){const{utils:d}=v(this);this.$delay(function(){let n=this.$refs.focus;n!=null&&n.focus()}),this.nameOrEmail="",this.isSent=!1,this.email="",this.action="send",this.before=function(){},this.success=function(n){this.action=="send"?(this.isSent=!0,this.action="update",this.email=n.data.email,this.$delay(function(){this.$refs.verifyCodeInput.focus()})):this.action=="update"&&d.success("你已成功设置了新密码，现在去登录",function(){window.location="/"})}}const B={class:"form-box"},E=t("td",{class:"title"},"用户名或邮箱 *",-1),O=t("p",{class:"comment"},"请输入你的用户名或者已经绑定的邮箱。",-1),D=t("td",{class:"title"},"用户名或邮箱",-1),N=t("td",null,"验证码 *",-1),I={class:"comment"},P={class:"red"},T=t("td",null,"新登录密码 *",-1),R={class:"comment"},U={key:0},A=t("td",null,"确认新登录密码 *",-1),M=t("a",{href:"/login",class:"link ml-2"},"« 回登录页",-1),j={__name:"reset",setup(d){const n=h(),e=V(new k,{refs:{verifyCodeInput:n}});return(q,c)=>(f(),w(C,null,{default:l(()=>[t("div",B,[o(b,{action:"$",onSuccess:s(e).success,onBefore:s(e).before},{default:l(()=>[i(t("input",{type:"hidden",name:"action","onUpdate:modelValue":c[0]||(c[0]=m=>s(e).action=m)},null,512),[[y,s(e).action]]),o(g,null,{default:l(()=>[t("tbody",null,[i(t("tr",null,[E,t("td",null,[o(u,{name:"usernameOrEmail",placeholder:"用户名、邮箱",autofocus:"",modelValue:s(e).nameOrEmail,"onUpdate:modelValue":c[1]||(c[1]=m=>s(e).nameOrEmail=m),class:"w-full"},null,8,["modelValue"]),O])],512),[[r,!s(e).isSent]])]),i(t("tbody",null,[t("tr",null,[D,t("td",null,p(s(e).nameOrEmail),1)]),t("tr",null,[N,t("td",null,[o(u,{name:"code",style:{width:"6em"},maxlength:"6",ref_key:"verifyCodeInput",ref:n},null,512),t("p",I,[t("span",P,"6位数字验证码已经发送到邮箱"+p(s(e).email)+"，请查收。",1)])])]),t("tr",null,[T,t("td",null,[o(u,{type:"password",name:"newPass",maxlength:"100",class:"w-full"}),t("p",R,[a("长度不小于6位"),s(e).complexPassword?(f(),x("span",U,"，且必须包含大写字母和小写字母")):S("",!0),a("。 ")])])]),t("tr",null,[A,t("td",null,[o(u,{type:"password",name:"newPass2",maxlength:"100",class:"w-full"})])])],512),[[r,s(e).isSent]])]),_:1}),i(o(_,null,{default:l(()=>[a("下一步")]),_:1},512),[[r,!s(e).isSent]]),i(o(_,null,{default:l(()=>[a("保存新密码")]),_:1},512),[[r,s(e).isSent]]),a("   "),M]),_:1},8,["onSuccess","onBefore"])])]),_:1}))}};$({app:j,useRouter:!1});
