diff --git a/src/Conf.php b/src/Conf.php index ddae083..bea0595 100644 --- a/src/Conf.php +++ b/src/Conf.php @@ -32,7 +32,7 @@ class Conf extends SplBean public $fontSize = 25; // 字体大小 public $length = 4; // 生成位数 public $mime = MIME::PNG; // 设置类型 - public $temp = EASYSWOOLE_ROOT . '/Temp/Captcha/'; // 设置缓存目录 + public $temp = '/tmp'; // 设置缓存目录 public function setTemp($temp){ if (!is_dir($temp)) mkdir($temp,0755) && chmod($temp,0755); diff --git a/src/VerifyCode.php b/src/VerifyCode.php index beeaa4c..d3f3d05 100644 --- a/src/VerifyCode.php +++ b/src/VerifyCode.php @@ -56,6 +56,8 @@ function DrawCode($Code = null) $Code = substr(str_shuffle($this->charset), 0, $this->length); } + $Code = strval($Code); + // 创建空白画布 $this->imInstance = imagecreate($this->imageL, $this->imageH); // 设置背景颜色