时间:2021-07-01 10:21:17 帮助过:11人阅读
  哈哈 我自己解决了 原是这样啊!!我在框架验证码那个类里加了一行后才不对的public function run()  
 {  
 //$this->fixedVerifyCode=substr(mt_rand(1,10000),0,4);//优化验证码  
 if(isset($_GET[self::REFRESH_GET_VAR]))  // AJAX request for regenerating code  
 {  
 $code=$this->getVerifyCode(true);  
 echo CJSON::encode(array(  
 'hash1'=>$this->generateValidationHash($code),  
 'hash2'=>$this->generateValidationHash(strtolower($code)),  
 // we add a random 'v' parameter so that FireFox can refresh the image  
 // when src attribute of image tag is changed  
 'url'=>$this->getController()->createUrl($this->getId(),array('v' => uniqid())),  
 ));  
 }  
 else  
 $this->renderImage($this->getVerifyCode());  
 Yii::app()->end();  
 }  
  
 就加了那一行优化验证码后就不对了 注释掉后 就对了