12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\home\controller;
- use think\captcha\facade\Captcha;
- class Seccode
- {
-
- public function makecode()
- {
- $config = [
- 'fontSize' => 20,
- 'length' => 4,
- 'useNoise' => false,
- 'useCurve' => true,
- 'imageH' => 50,
- 'imageW' => 150,
- ];
- config($config, 'captcha');
- $captcha = Captcha::create();
- return $captcha;
- }
-
- public function check()
- {
- $config = [];
- if (input('param.reset') == 'false') {
-
- $config['reset'] = FALSE;
- }
- config($config, 'captcha');
- $code = input('param.captcha');
- if (captcha_check($code)) {
- exit('true');
- } else {
- exit('false');
- }
- }
- }
|