This commit is contained in:
2022-10-21 15:04:26 +08:00
parent c2ef23b746
commit 9b880e3209
2 changed files with 10 additions and 11 deletions

View File

@@ -20,10 +20,9 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
def call
raise Error, errors.full_messages.join(",") unless valid?
raise Error, "密码不正确." unless @user.check_password?(@password)
if !(@verify_code == "123123" && EduSetting.get("code_debug")) # 万能验证码,用于测试 # TODO 万能验证码,用于测试
raise Error, "验证码不正确." if @verify_code&.code != @code
raise Error, "验证码已失效." if !@verify_code&.effective?
end
is_debug = @code == "123123" && EduSetting.get("code_debug") # 万能验证码,用于测试 # TODO 万能验证码,用于测试
raise Error, "验证码不正确." if @verify_code&.code != @code && !is_debug
raise Error, "验证码已失效." if !@verify_code&.effective? && !is_debug
# begin
ActiveRecord::Base.transaction do