Przeglądaj źródła

验证码GD渲染

York 3 lat temu
rodzic
commit
5aa48fca66
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      common/helpers/CaptchaAction.php

+ 1 - 2
common/helpers/CaptchaAction.php

@@ -65,8 +65,7 @@ class CaptchaAction extends \yii\captcha\CaptchaAction
         // 设置文字
         for ($i = 0; $i < $length; ++$i) {
             $fontSize = (int)(rand(26, 32) * $scale * 0.8);
-            //$angle = rand(-10, 10);
-            $angle = rand(-100, 10);
+            $angle = rand(-10, 10);
             $letter = $code[$i];
             $box = imagettftext($image, $fontSize, $angle, $x, $y, $foreColor, $this->fontFile, $letter);
             $x = $box[2] + $this->offset;