Files
zyt/identity-admin/web/dist/assets/validation-Co109C3A.js
2026-11-11 14:22:02 +08:00

2 lines
524 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function g(r,n=!1){return[{trigger:"blur",validator(f,t,e){if(!t&&!r){e();return}if(typeof t!="string"||!t){e(new Error("请输入密码"));return}const o=new TextEncoder().encode(t).length,i=n?6:10,s=n?32:72;if(o<i||o>s||t.includes("\0")){e(new Error(`密码须为 ${i}–${s} 字节(一个汉字通常占 3 字节)`));return}e()}}]}function d(r){if(!r)return"—";const n=typeof r=="number"?new Date(r*1e3):new Date(r);return Number.isNaN(n.getTime())?String(r):n.toLocaleString("zh-CN",{hour12:!1})}export{d,g as p};