diff --git a/app/common/library/AdminTotp.php b/app/common/library/AdminTotp.php index dfcbc6c..bddd206 100644 --- a/app/common/library/AdminTotp.php +++ b/app/common/library/AdminTotp.php @@ -27,7 +27,8 @@ class AdminTotp if ($issuer === '') { $issuer = 'BuildAdmin'; } - self::$tfa = new TwoFactorAuth(new BaconQrCodeProvider(), $issuer); + // 使用 SVG 格式,避免依赖 imagick 扩展(PNG 默认需要 ImagickImageBackEnd) + self::$tfa = new TwoFactorAuth(new BaconQrCodeProvider(format: 'svg'), $issuer); } return self::$tfa; }