Explorar el Código

验证码GD渲染

York hace 3 años
padre
commit
5aa48fca66
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  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;