fix user profile update

This commit is contained in:
Timi
2026-08-07 18:20:29 +08:00
parent 82e717e3c6
commit 16fa5fdd36
10 changed files with 386 additions and 73 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
* @param name 头像中显示的用户名
* @param backgroundColor 头像背景色
*/
export function buildFallbackAvatar(name: string, backgroundColor = "#2563eb"): string {
const text = encodeURIComponent((name.trim() || "用户").slice(0, 2));
export function buildFallbackAvatar(name?: string, backgroundColor = "#2563eb"): string {
const text = encodeURIComponent((name?.trim() || "用户").slice(0, 2));
const fill = encodeURIComponent(backgroundColor);
return [
"data:image/svg+xml;charset=UTF-8,",