|
|
|
@ -15,6 +15,7 @@ use think\cache\driver\Redis; |
|
|
|
use think\exception\ValidateException; |
|
|
|
use think\facade\Db; |
|
|
|
use think\Request; |
|
|
|
use think\Response; |
|
|
|
|
|
|
|
class Wechat extends Base |
|
|
|
{ |
|
|
|
@ -83,7 +84,7 @@ class Wechat extends Base |
|
|
|
validate(WechatUserValidate::class)->scene('savePuCode')->check($param); |
|
|
|
$res = (new AuthCodeUtil(new Redis()))->verifyCode($param['mobile'],$param['snsCode']); |
|
|
|
if (!$res) { |
|
|
|
throw new \Exception('短信验证码错误'); |
|
|
|
throw new ValidateException('短信验证码错误'); |
|
|
|
} |
|
|
|
} catch (ValidateException $e) { |
|
|
|
return $this->buildFailed(ReturnCode::INVALID,$e->getMessage()); |
|
|
|
|