chore: 恢复旧布局基线(迁移改动丢失后重建,apps/packages 布局暂存)

This commit is contained in:
logan committed 2026-10-14 20:31:17 +08:00
1 parent a9510235bb
commit 456fa6954b
203 files changed
+18787 -48

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
const PREFIX = "ox1.";
/** 本机混淆,不是保险箱。专业客户端最终应走 OS Keychain。 */
export function encodeSecret(plain: string): string {
if (!plain || plain.startsWith(PREFIX)) return plain;
try {
return PREFIX + btoa(unescape(encodeURIComponent(plain)));
} catch {
return plain;
}
}
export function decodeSecret(stored: string): string {
if (!stored) return "";
if (!stored.startsWith(PREFIX)) return stored;
try {
return decodeURIComponent(escape(atob(stored.slice(PREFIX.length))));
} catch {
return stored;
}
}
export function sanitizeSecret(raw: string): string {
return raw.replace(/[\u200B-\u200D\uFEFF]/g, "").trim();
}