From 3f7366fbcd16a532179f84096aac34bf60330302 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 21 Oct 2022 15:28:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=80=9A=E7=9F=A5=E9=82=AE=E7=AE=B1=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E8=87=AA=E5=B7=B1=E6=94=B9=E8=87=AA=E5=B7=B1=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/v1/users/update_email_service.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/services/api/v1/users/update_email_service.rb b/app/services/api/v1/users/update_email_service.rb index 99f990631..d17f101fd 100644 --- a/app/services/api/v1/users/update_email_service.rb +++ b/app/services/api/v1/users/update_email_service.rb @@ -26,7 +26,7 @@ class Api::V1::Users::UpdateEmailService < ApplicationService raise Error, "验证码不正确." if @verify_code&.code != @code && !is_debug raise Error, "验证码已失效." if !@verify_code&.effective? && !is_debug - # begin + begin ActiveRecord::Base.transaction do change_user_email excute_data_to_gitea @@ -35,15 +35,15 @@ class Api::V1::Users::UpdateEmailService < ApplicationService return gitea_data - # rescue - # raise Error, "服务器错误,请联系系统管理员!" - # end + rescue + raise Error, "服务器错误,请联系系统管理员!" + end end private def request_params { - access_token: token + access_token: @user.gitea_token } end