feat: 安全设置展示有效登录会话,支持剔除其它设备

按设备指纹去重并直出 IP;非当前会话可踢下线,对方需重新输入密码。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-18 01:48:52 +08:00
parent 2ccfb5f330
commit 3a7bfe59df
16 changed files with 808 additions and 28 deletions

View File

@@ -47,3 +47,10 @@ export function formatDate(dateStr: string): string {
const d = new Date(dateStr);
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
}
/** 完整日期时间 YYYY-MM-DD HH:mm:ss(本地时区) */
export function formatDateTime(dateStr: string): string {
const d = new Date(dateStr);
if (Number.isNaN(d.getTime())) return "";
return `${formatDate(dateStr)} ${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`;
}