Explorar o código

验证码GD渲染

York %!s(int64=3) %!d(string=hai) anos
pai
achega
5aa48fca66
Modificáronse 1 ficheiros con 1 adicións e 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;