fix(user): harden profile and MFA workflows (#666)

This commit is contained in:
InfinityPacer
2026-08-11 23:17:58 +08:00
committed by GitHub
parent 6c384bf1ee
commit df4d697845
9 changed files with 951 additions and 57 deletions
+12 -1
View File
@@ -1,4 +1,4 @@
import type { User } from '@/api/types'
import type { PassKey, User } from '@/api/types'
import { DEFAULT_PERMISSIONS } from '@/utils/permission'
/** 构造与用户查询接口一致的稳定测试数据。 */
@@ -16,3 +16,14 @@ export function createUser(overrides: Partial<User> = {}): User {
...overrides,
}
}
/** 构造与通行密钥列表接口一致的稳定测试数据。 */
export function createPassKey(overrides: Partial<PassKey> = {}): PassKey {
return {
id: 11,
name: 'MacBook Touch ID',
created_at: '2026-08-01T08:00:00Z',
last_used_at: '2026-08-10T08:00:00Z',
...overrides,
}
}