feat: 优化web

This commit is contained in:
2026-04-23 18:58:13 +08:00
commit 544a2f3428
160 changed files with 27327 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/** 仅允许站内相对路径,防止开放重定向 */
export function safeReturnPath(from: string | null | undefined, fallback = '/dashboard'): string {
if (from == null || typeof from !== 'string') {
return fallback;
}
const t = from.trim();
if (!t.startsWith('/') || t.startsWith('//')) {
return fallback;
}
return t;
}