YYC松鼠短视频系统V2.0+版本上 验证码未判断验证码正确bug
 
 
YYC松鼠短视频系统V2.0+版本上 验证码未判断验证码正确bug问题, 
/songshu-video-back/application/api/controller/User.php文件 
 
修改666行, 
修改为-  public function postRegister()
 
 -     {
 
 -         //用户不存在,自动注册
 
 -         $username = input('username');
 
 -         $password = input('password');
 
 -         $mailStr = input("mail");
 
 -         $vcode=input("vcode");
 
 -         $invitecode = input('invitecode');
 
  
-         $user = Db("user")->where(['username' => $username])->find();
 
 -         if ($user) {
 
 -             return error("该用户名已存在,请重新输入");
 
 -         }
 
 -         $user = config('mail_user');
 
 -         $pass = config('mail_pass');
 
 -         $name = config("mail_name");
 
 -         $smtp = config('mail_smtp');
 
 -         $mail = new Mail($user,$pass,$name,$smtp);
 
 -         if(!$mail->verifyCode($mailStr,$vcode)){
 
 -             return error("验证码错误,请重新输入");
 
 -         }
 
 -         //上级绑定
 
 -         $parent = NULL;
 
 -         if (strlen($invitecode) > 0) {
 
 -             $parent = Db('user')->where('invit_code', $invitecode)->where('disable', 0)->find();
 
 -             if (!$parent) {
 
 -                 return error('邀请码不正确');
 
 -             }
 
 -         }
 
  复制代码 
 
 
核心就是这 
 
    if(!$mail->verifyCode($mailStr,$vcode)){ 
            return error("验证码错误,请重新输入"); 
        } 
 
 |   
 
  
 | 
| 
 | 
| 
 | 
| 
 |