fixed 第三方授权登录(github,gitee,qq,wechat),输出URL到前端

This commit is contained in:
xxq250 2022-12-01 18:03:06 +08:00
parent 5717d0c69f
commit cbe10b4b89
2 changed files with 19 additions and 0 deletions

View File

@ -7,6 +7,7 @@ class SettingsController < ApplicationController
get_sub_competitions
get_personal_menu
get_third_party
get_third_party_new
get_top_system_notification
end
@ -67,6 +68,23 @@ class SettingsController < ApplicationController
url: EducoderOauth.oauth_url
}
end
def get_third_party_new
@third_party_new = []
@third_party_new << {
name: 'educoder',
url: EducoderOauth.oauth_url,
method: 'get'
}
config = Rails.application.config_for(:configuration)
(config.dig("oauth").keys - ["educoder"]).each do |provider|
@third_party_new << {
name: provider,
url: "/auth/#{provider}",
method: 'post'
}
end
end
def get_top_system_notification
@top_system_notification = SystemNotification.is_top.first

View File

@ -61,6 +61,7 @@ json.setting do
json.common @common
json.third_party @third_party
json.third_party_new @third_party_new
if @top_system_notification.present?
json.system_notification do