|
|
|
@ -13,7 +13,7 @@ class Users::BindEmailService < ApplicationService
|
|
|
|
|
|
|
|
|
|
raise Error, '该邮箱已被绑定' if User.where.not(id: user.id).exists?(mail: params[:email])
|
|
|
|
|
|
|
|
|
|
code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 4).last
|
|
|
|
|
code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 5).last
|
|
|
|
|
raise Error, '验证码无效' unless code&.effective?
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|