You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2 lines
1.9 KiB

import{u as r}from"./B-sqZCu-.js";import{g as x,c as i,a as t,t as o,l as f,o as l}from"./DMxDLVSv.js";const b={key:0,class:"modal modal-open"},u={class:"modal-box max-w-md"},p={class:"font-bold text-base mb-1"},y={class:"rounded-xl border border-slate-200 bg-slate-50 p-3 space-y-2"},g={class:"flex items-center justify-between gap-3"},v={class:"font-mono font-semibold text-sm"},_={class:"flex items-center justify-between gap-3"},w={class:"font-mono font-semibold text-sm"},h={key:0,class:"mt-3 text-xs text-emerald-600"},k={key:1,class:"mt-3 text-xs text-amber-600"},C={class:"modal-action"},T=x({__name:"AccountCredentialDialog",props:{info:{}},emits:["close"],setup(s){const n=s,{success:c,warn:m}=r();async function d(){if(!n.info)return;const a=`用户名:${n.info.username}
初始密码:${n.info.password}`;try{await navigator.clipboard.writeText(a),c("凭据已复制")}catch{m("复制失败,请手工记录")}}return(a,e)=>s.info?(l(),i("div",b,[t("div",u,[t("h3",p,o(s.info.title),1),e[3]||(e[3]=t("p",{class:"text-xs text-slate-400 mb-3"},"初始密码仅在此显示一次,关闭后无法再查看(如需重设请到「后台账号」改密)。",-1)),t("div",y,[t("div",g,[e[1]||(e[1]=t("span",{class:"text-xs text-slate-500"},"登录用户名",-1)),t("span",v,o(s.info.username),1)]),t("div",_,[e[2]||(e[2]=t("span",{class:"text-xs text-slate-500"},"初始密码",-1)),t("span",w,o(s.info.password),1)])]),s.info.mailTo?(l(),i("div",h," ✓ 凭据已邮件发送至 "+o(s.info.mailTo),1)):(l(),i("div",k," ⚠ 凭据未能邮件送达"+o(s.info.mailError?":"+s.info.mailError:"")+",请手工转达上面的用户名和密码。 ",1)),t("div",C,[t("button",{class:"btn btn-ghost btn-sm",onClick:d},"复制"),t("button",{class:"btn btn-primary btn-sm text-white",onClick:e[0]||(e[0]=$=>a.$emit("close"))},"我已记录,关闭")])])])):f("",!0)}}),D=Object.assign(T,{__name:"AccountCredentialDialog"});export{D as _};