CaptchaController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. namespace fecadmin\controllers;
  10. use Yii;
  11. use yii\web\Controller;
  12. /**
  13. * @author Terry Zhao <2358269014@qq.com>
  14. * @since 1.0
  15. */
  16. class CaptchaController extends Controller
  17. {
  18. public function actions()
  19. {
  20. return [
  21. 'error' => [
  22. 'class' => 'yii\web\ErrorAction',
  23. ],
  24. 'index' => [
  25. 'class' => 'fec\helpers\CCaptchaAction',
  26. 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
  27. 'padding' => 0,//间距
  28. 'height'=>40,//高度
  29. 'width' => 80, //宽度
  30. 'offset'=>4,
  31. //'foreColor'=>0xffffff, //字体颜色
  32. ],
  33. ];
  34. }
  35. /*
  36. 'class' => 'fec\helpers\CCaptchaAction',
  37. 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
  38. 'backColor'=>0x000000,//背景颜色
  39. 'maxLength' => 6, //最大显示个数
  40. 'minLength' => 5,//最少显示个数
  41. 'padding' => 5,//间距
  42. 'height'=>40,//高度
  43. 'width' => 130, //宽度
  44. 'foreColor'=>0xffffff, //字体颜色
  45. 'offset'=>4, //设置字符偏移量 有效果
  46. //'controller'=>'login', //拥有这个动作的controller
  47. */
  48. }