PageSourceSearch

https://loverhub.ai/assets/MerchantResetPasswordView-C4rrHGsp.js

js loverhub.ai collected 2026-10-05 15:38:15 UTC 3,938 bytes, 1 lines download raw bytes

1import{q as E,G as s,A as n,B as t,K as _,U as I,u as l,ar as $,C as g,D as P,aP as F,J as U,F as H,L as M,M as L,H as w,O as R,P as A,E as S,f as m,r}from"./vendor-icons-Bxvif_pP.js";import{F as K,R as O,L as T,X as G,Y as J,f as W,g as X,V as Y,W as j,i as Q}from"./index-DESokjJk.js";const Z=["aria-label"],ee={class:"reset-top"},te={class:"reset-panel"},ae={class:"panel-title"},se={key:0,class:"feedback feedback--error"},oe={class:"password-field"},ne=["type"],le=["aria-label"],re={class:"password-field"},ue=["type"],ie=["aria-label"],de={key:0,class:"feedback feedback--ok"},ce={key:1,class:"feedback feedback--error"},pe=["disabled"],ve=E({__name:"MerchantResetPasswordView",setup(me){const k=W(),q=X(),B=K(),y=m(()=>Y(k.params.accountType)),x=m(()=>j(y.value)),V=m(()=>`/merchant/${y.value}/login`),h=m(()=>typeof k.query.token=="string"?k.query.token.trim():""),u=r(""),i=r(""),f=r(!1),b=r(!1),d=r(""),c=r(!1),p=r(!1),z=m(()=>h.value.length>=32&&u.value.trim().length>=8&&i.value.trim().length>=8&&!f.value);function C(v,e){const a=v.target,o=a.value.replace(/^\s+/,"");e==="new"&&(u.value=o),e==="confirm"&&(i.value=o),a.value!==o&&(a.value=o)}async function N(){var e,a;if(!z.value)return;d.value="";const v=T(u.value);if(v!==T(i.value)){d.value="两次输入的新密码不一致。";return}f.value=!0;try{await G.post("merchant/auth/password-reset/confirm",{account_type:y.value,token:h.value,new_password:v}),J(null),B.clearSession(),u.value="",i.value="",b.value=!0}catch(o){d.value=((a=(e=o==null?void 0:o.response)==null?void 0:e.data)==null?void 0:a.detail)||"重设链接无效或已过期。"}finally{f.value=!1}}async function D(){await q.push(V.value)}return(v,e)=>(s(),n("section",{class:"merchant-reset-page","aria-label":`${x.value}重设密码`},[t("header",ee,[_(l(O),{class:"back-link",to:V.value},{default:I(()=>[_(l($),{size:17,"stroke-width":2.3,"aria-hidden":"true"}),e[6]||(e[6]=g(" 返回登录 ",-1))]),_:1},8,["to"]),t("strong",null,P(x.value),1),e[7]||(e[7]=t("span",{"aria-hidden":"true"},null,-1))]),t("main",te,[t("header",ae,[_(l(F),{size:20,"stroke-width":2.3,"aria-hidden":"true"}),e[8]||(e[8]=t("div",null,[t("strong",null,"设置新密码"),t("small",null,"完成后所有设备需要重新登录")],-1))]),t("form",{class:"reset-form",onSubmit:U(N,["prevent"])},[h.value.length<32?(s(),n("p",se," 重设链接无效,请重新申请重设邮件。 ")):(s(),n(H,{key:1},[t("label",null,[e[9]||(e[9]=g(" 新密码 ",-1)),t("span",oe,[M(t("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>u.value=a),type:c.value?"text":"password",autocomplete:"new-password",minlength:"8",required:"",placeholder:"至少 8 位",onInput:e[1]||(e[1]=a=>C(a,"new"))},null,40,ne),[[L,u.value]]),t("button",{type:"button","aria-label":c.value?"隐藏新密码":"显示新密码",onClick:e[2]||(e[2]=a=>c.value=!c.value)},[c.value?(s(),w(l(R),{key:0,size:17,"stroke-width":2.2})):(s(),w(l(A),{key:1,size:17,"stroke-width":2.2}))],8,le)])]),t("label",null,[e[10]||(e[10]=g(" 确认新密码 ",-1)),t("span",re,[M(t("input",{"onUpdate:modelValue":e[3]||(e[3]=a=>i.value=a),type:p.value?"text":"password",autocomplete:"new-password",minlength:"8",required:"",onInput:e[4]||(e[4]=a=>C(a,"confirm"))},null,40,ue),[[L,i.value]]),t("button",{type:"button","aria-label":p.value?"隐藏确认密码":"显示确认密码",onClick:e[5]||(e[5]=a=>p.value=!p.value)},[p.value?(s(),w(l(R),{key:0,size:17,"stroke-width":2.2})):(s(),w(l(A),{key:1,size:17,"stroke-width":2.2}))],8,ie)])]),b.value?(s(),n("p",de,"密码已更新,请使用新密码重新登录。")):S("",!0),d.value?(s(),n("p",ce,P(d.value),1)):S("",!0),b.value?(s(),n("button",{key:3,class:"primary-action",type:"button",onClick:D},"返回登录")):(s(),n("button",{key:2,class:"primary-action",type:"submit",disabled:!z.value},P(f.value?"更新中...":"重设密码"),9,pe))],64))],32)])],8,Z))}}),ke=Q(ve,[["__scopeId","data-v-79512bd3"]]);export{ke as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.