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-BYcXwl4U.js";import{i as v,c as V}from"./app-a6cKceqE.js";/* empty css            */import{_}from"./app-CignoBaV.js";import{_ as u}from"./app-Ufpj4Ll4.js";import{_ as b}from"./app-CQ-vNlMj.js";import{_ as C}from"./app-Dm_95vqi.js";import{D as g}from"./app-7GBSHA5C.js";import"./app-CrjU8lgK.js";import"./app-ysQ8KbGS.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-u5shTDG_.js";import"./app-SsPWW0_a.js";import"./app-C14NbwKQ.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});
