fix: shorten avatar URL to fit VARCHAR(255) column

Previous avataaars URL with style params exceeded 280 chars, got truncated
in database causing blank avatars. Shortened to ~60 chars.
This commit is contained in:
li
2026-04-06 10:54:43 +08:00
parent 7d7f53b356
commit 2ec8e9776b
+3 -3
View File
@@ -187,9 +187,9 @@ class User extends Api
}
// }
$extend['pay_pwd'] = strtoupper(md5(strtoupper(md5($pwd2.'skund'))));
// 生成随机虚拟头像 (DiceBear avataaars - 男性商务风格)
$avatarSeed = md5(uniqid(mt_rand(), true));
$extend['avatar'] = 'https://api.dicebear.com/9.x/avataaars/png?seed=' . $avatarSeed . '&size=200&top=shortHairShortFlat,shortHairShortRound,shortHairShortWaved,shortHairSides,shortHairTheCaesar,shortHairShortCurly&clothing=blazerAndSweater,blazerAndShirt&clothingColor=262e33,3c4f5c,65c9ff,25557c,929598';
// 生成随机虚拟头像 (DiceBear avataaars 商务风格URL需<255字符)
$avatarSeed = substr(md5(uniqid(mt_rand(), true)), 0, 8);
$extend['avatar'] = 'https://api.dicebear.com/9.x/avataaars/png?seed=' . $avatarSeed;
$extend['referral_code'] = $this->create_invite_code(); //推荐码
//注册钱包eth
$ret = $this->auth->register($username, $password, $email, $mobile, $extend);