VerifyController.class.php 492 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Mobile\Controller;
  3. class VerifyController extends \Think\Controller
  4. {
  5. protected function _initialize()
  6. {
  7. $allow_action = array("code");
  8. if(!in_array(ACTION_NAME,$allow_action)){
  9. $this->error("非法操作");
  10. }
  11. }
  12. public function code()
  13. {
  14. $config['useNoise'] = true; // 关闭验证码杂点
  15. $config['length'] = 4; // 验证码位数
  16. $config['codeSet'] = '123456789';
  17. ob_clean();
  18. $verify = new \Think\Verify($config);
  19. $verify->entry(1);
  20. }
  21. }
  22. ?>