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