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_sub_competitions
|
||||||
get_personal_menu
|
get_personal_menu
|
||||||
get_third_party
|
get_third_party
|
||||||
|
get_third_party_new
|
||||||
get_top_system_notification
|
get_top_system_notification
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -68,6 +69,23 @@ class SettingsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
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
|
def get_top_system_notification
|
||||||
@top_system_notification = SystemNotification.is_top.first
|
@top_system_notification = SystemNotification.is_top.first
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,6 +61,7 @@ json.setting do
|
||||||
|
|
||||||
json.common @common
|
json.common @common
|
||||||
json.third_party @third_party
|
json.third_party @third_party
|
||||||
|
json.third_party_new @third_party_new
|
||||||
|
|
||||||
if @top_system_notification.present?
|
if @top_system_notification.present?
|
||||||
json.system_notification do
|
json.system_notification do
|
||||||
|
|
Loading…
Reference in New Issue