feat(web): call the login name the account ID and list sign-up requirements

This commit is contained in:
justme committed 2026-10-16 17:54:31 +08:00
1 parent 700be2ebae
commit 79bfd560cb
6 files changed
+49 -10

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ export function unlockedAccount() {
let restoration: Promise<void> | undefined;
export function usernameOf(input: string): string {
const username = input.trim().toLowerCase();
if (!/^[a-z0-9_-]{3,32}$/.test(username)) throw new Error('用户名需为 3–32 位字母、数字、下划线或短横线');
if (!/^[a-z0-9_-]{3,32}$/.test(username)) throw new Error('账号 ID 需为 3–32 位字母、数字、下划线或短横线');
return username;
}
function headers(session: Pick<AccountSession, 'token'>): Record<string, string> { return { 'X-WD-Account': session.token }; }