mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-07-15 06:34:32 +08:00
修复:更新邮箱失败
This commit is contained in:
@@ -61,13 +61,17 @@ class Api::V1::Users::UpdateEmailService < ApplicationService
|
|||||||
end
|
end
|
||||||
|
|
||||||
def excute_data_to_gitea
|
def excute_data_to_gitea
|
||||||
Rails.logger.info request_body
|
|
||||||
@gitea_data = $gitea_client.patch_admin_users_by_username(@user.login, {body: request_body.to_json})
|
@gitea_data = $gitea_client.patch_admin_users_by_username(@user.login, {body: request_body.to_json})
|
||||||
end
|
end
|
||||||
|
|
||||||
def excute_change_email_from_gitea
|
def excute_change_email_from_gitea
|
||||||
$gitea_client.delete_user_emails({body: {emails: [@old_mail]}.to_json, query: request_params})
|
emails = $gitea_client.get_user_emails({query: request_params})
|
||||||
$gitea_client.post_user_emails({body: {emails: [@mail]}.to_json, query: request_params})
|
puts "emails=#{emails}"
|
||||||
|
emails.each do |email|
|
||||||
|
email = email.stringify_keys
|
||||||
|
next if email["email"] == @mail
|
||||||
|
$gitea_client.delete_user_emails({body: {emails: [email["email"]]}.to_json, query: request_params})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_old_cache_for_user
|
def remove_old_cache_for_user
|
||||||
|
|||||||
Reference in New Issue
Block a user