修复:更改用户通知邮箱只能自己改自己的

This commit is contained in:
yystopf 2022-10-21 15:28:48 +08:00
parent cfdbc5a682
commit 3f7366fbcd
1 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
raise Error, "验证码不正确." if @verify_code&.code != @code && !is_debug raise Error, "验证码不正确." if @verify_code&.code != @code && !is_debug
raise Error, "验证码已失效." if !@verify_code&.effective? && !is_debug raise Error, "验证码已失效." if !@verify_code&.effective? && !is_debug
# begin begin
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
change_user_email change_user_email
excute_data_to_gitea excute_data_to_gitea
@ -35,15 +35,15 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
return gitea_data return gitea_data
# rescue rescue
# raise Error, "服务器错误,请联系系统管理员!" raise Error, "服务器错误,请联系系统管理员!"
# end end
end end
private private
def request_params def request_params
{ {
access_token: token access_token: @user.gitea_token
} }
end end