1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?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');
- }
- }
- }
|