forked from Gitlink/forgeplus
fixed 第三方授权登录(github,gitee,qq,wechat),输出URL到前端
This commit is contained in:
parent
5717d0c69f
commit
cbe10b4b89
|
@ -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
|
||||
|
||||
|
@ -68,6 +69,23 @@ class SettingsController < ApplicationController
|
|||
}
|
||||
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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue