import{f as s,k as o,E as e,P as a}from"./souav-BTAG2baT.js";import{S as r,a as t}from"./vendor-DeXdhdID.js";import{ag as l,d,a4 as n,a5 as i,ad as c,aW as m}from"./vendor-BXdGExd0.js";import{j as f,i as p}from"./vendor-BJZ6tUoe.js";import{_ as u}from"./vendor-BCo6x5W8.js";import"./vendor-CDxkAdJH.js";import"./vendor-Cv8m7sE6.js";import"./vendor-bo_0oRCG.js";import"./vendor-CB_mu4eO.js";import"./vendor-Dos3PyFQ.js";import"./vendor-Dwl46Tfs.js";import"./vendor-DN37M9Hi.js";import"./vendor-BHR_E30J.js";import"./vendor-DzK633Zd.js";import"./vendor-CfyHAoLP.js";import"./vendor-Dm4oB1Pn.js";import"./vendor-DBhUxCDU.js";const w={class:"min-h-dvh bg-[#0E0F12] flex flex-col"},v={class:"flex flex-col items-center w-full pt-10"},P=u(l({__name:"ModifyPassword",emits:["ppw-close"],setup(l,{emit:u}){const P=s(),x=u,j=()=>{x("ppw-close")},b=d({oldPassword:"",newPassword:"",confirmPassword:""}),h=async()=>{if(!b.oldPassword)return void f("请输入原密码");if(!b.newPassword)return void f("请输入新密码");if(!b.confirmPassword)return void f("请确认新密码");if(b.newPassword!==b.confirmPassword)return void f("两次输入的密码不一致");if(b.oldPassword===b.newPassword)return void f("新密码不能与旧密码相同");if(!t(b.newPassword))return void f("密码格式不正确");const s=p({message:"提交中...",forbidClick:!0,duration:0});try{const s={oldPassword:o.toMD5(b.oldPassword),newPassword:o.toMD5(b.newPassword)},a=await P.modifyPassword(s),{code:r,data:t}=a;r===e.Success?(P.refreshSessionId(t.sessionId),f("修改成功"),setTimeout(()=>{j()},1e3)):f(a.msg||"修改失败")}catch(a){f("网络异常，请稍后重试")}finally{s.close()}},y=()=>{a.open("RetrievePassword",{transition:"slide-fade"})},g=s=>{const o=s.target;if("INPUT"!==o.tagName&&"BUTTON"!==o.tagName){const s=document.activeElement;s&&"INPUT"===s.tagName&&s.blur()}};return(s,o)=>(m(),n("div",w,[i("header",{class:"sticky top-0 z-50 flex items-center justify-center h-12 border-b border-[#1D1E22]"},[i("button",{onClick:j,class:"absolute left-4 p-2"},[...o[3]||(o[3]=[i("i",{class:"icon-sprite icon-back"},null,-1)])]),o[4]||(o[4]=i("h1",{class:"text-lg font-medium text-white font-sans"},"修改密码",-1))]),i("main",{class:"flex-1 overflow-y-auto px-8",onClick:g},[i("div",v,[c(r,{label:"原密码",placeholder:"请填写原密码",modelValue:b.oldPassword,"onUpdate:modelValue":o[0]||(o[0]=s=>b.oldPassword=s)},null,8,["modelValue"]),o[5]||(o[5]=i("div",{class:"h-4"},null,-1)),c(r,{label:"新密码",placeholder:"请填写新密码",modelValue:b.newPassword,"onUpdate:modelValue":o[1]||(o[1]=s=>b.newPassword=s)},null,8,["modelValue"]),o[6]||(o[6]=i("div",{class:"h-4"},null,-1)),c(r,{label:"确认密码",placeholder:"请再次填写新密码",modelValue:b.confirmPassword,"onUpdate:modelValue":o[2]||(o[2]=s=>b.confirmPassword=s)},null,8,["modelValue"]),o[7]||(o[7]=i("div",{class:"h-2"},null,-1)),o[8]||(o[8]=i("div",{class:"w-full text-left text-[#E32D5F] text-xs"}," 密码必须是8-16位英文字母、数字、字符组合（不能是纯数字） ",-1)),o[9]||(o[9]=i("div",{class:"h-9"},null,-1)),i("button",{onClick:h,class:"w-[220px] h-[40px] rounded-[20px] bg-[#F2C94C] text-black text-[14px] font-bold flex items-center justify-center hover:opacity-90 active:scale-95 transition-all"}," 立即提交 "),o[10]||(o[10]=i("div",{class:"h-4"},null,-1)),i("div",{class:"w-[300px] flex justify-end"},[i("span",{onClick:y,class:"text-[#F2C94C] text-[12px] cursor-pointer active:opacity-70"}," 忘记原密码？ ")])])])]))}}),[["__scopeId","data-v-d1fbbf66"]]);export{P as default};
