From 8a33ea6707a366893f2c81b8ed3ffb717173ac7a Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 21 Oct 2022 14:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/v1/users/update_email_service.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/api/v1/users/update_email_service.rb b/app/services/api/v1/users/update_email_service.rb index e11dd2f61..2d7631cc2 100644 --- a/app/services/api/v1/users/update_email_service.rb +++ b/app/services/api/v1/users/update_email_service.rb @@ -20,8 +20,10 @@ class Api::V1::Users::UpdateEmailService < ApplicationService def call raise Error, errors.full_messages.join(",") unless valid? raise Error, "密码不正确." unless @user.check_password?(@password) - raise Error, "验证码不正确." if @verify_code&.code != @code - raise Error, "验证码已失效." if !@verify_code&.effective? + if !(code == "123123" && EduSetting.get("code_debug")) # 万能验证码,用于测试 # TODO 万能验证码,用于测试 + raise Error, "验证码不正确." if @verify_code&.code != @code + raise Error, "验证码已失效." if !@verify_code&.effective? + end # begin ActiveRecord::Base.transaction do