开启验证

This commit is contained in:
2023-05-12 20:31:38 +08:00
parent c24fecbe06
commit c9df01bd16
5 changed files with 45 additions and 36 deletions
+13 -10
View File
@@ -246,16 +246,19 @@ class LoginService extends BaseService
$user_type = $this->request->input('user_type');
$wx_code = $this->request->input('wx_code');
// $redis = $this->container->get(Redis::class);
// // 验证验证码
// $sms_code = $redis->get("login_code" . $phone);
// if (empty($sms_code)){
// return fail(HttpEnumCode::CODE_EXPIRED);
// }
//
// if ($sms_code != $code){
// return fail(HttpEnumCode::CODE_ERROR);
// }
$app_env = config('app_env','dev');
if ($app_env != 'dev'){
$redis = $this->container->get(Redis::class);
// 验证验证码
$sms_code = $redis->get("login_code" . $phone);
if (empty($sms_code)){
return fail(HttpEnumCode::CODE_EXPIRED);
}
if ($sms_code != $code){
return fail(HttpEnumCode::CODE_ERROR);
}
}
try {
$weChat = new Wechat($user_type);