zac3533 1 éve
szülő
commit
1bdb417164

+ 1 - 1
application/api/controller/User.php

@@ -219,7 +219,7 @@ class User extends Api
         $code           = $this->request->post('country_code');
         $mobile         = $this->request->post('mobile');
         $captcha        = $this->request->post('captcha');
-        $token          = $this->request->post('token', $this->request->ip());
+        $token          = $this->request->post('token', ip2long($this->request->ip()));
         //   $id = $this->request->ip();
         if(!captcha_check($captcha,$token)){
             $this->error(__('验证码错误'));

+ 1 - 1
application/api/controller/Validate.php

@@ -31,7 +31,7 @@ class Validate extends Api
     public function get_captcha()
     {
         $captcha = new Captcha(['codeSet' => '0123456789', 'length' => 4]);
-        $id = $this->request->ip();
+        $id = ip2long($this->request->ip());
         return $captcha->entry($id);
 
 //        $id = uniqid();