From 73d89a89e2c771a3eee4fe52ae910dad181b4671 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 6 Dec 2022 10:12:41 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=99=BB=E5=BD=95=E9=85=8D=E7=BD=AEurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/settings_controller.rb | 3 ++- config/routes.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index e365c3e2..de07ed8f 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -76,11 +76,12 @@ class SettingsController < ApplicationController url: EducoderOauth.oauth_url, method: 'get' } + platform_url = Rails.application.config_for(:configuration)['platform_url'] config = Rails.application.config_for(:configuration) (config.dig("oauth").keys - ["educoder"]).each do |provider| @third_party_new << { name: provider, - url: "/auth/#{provider}", + url: "#{platform_url}/auth/#{provider}", method: 'post' } end diff --git a/config/routes.rb b/config/routes.rb index 0efac72c..22773794 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,7 @@ Rails.application.routes.draw do get 'attachments/download/:id', to: 'attachments#show' get 'attachments/download/:id/:filename', to: 'attachments#show' - get 'auth/qq/callback', to: 'oauth/qq#create' + # get 'auth/qq/callback', to: 'oauth/qq#create' get 'auth/failure', to: 'oauth/base#auth_failure' get 'auth/cas/callback', to: 'oauth/cas#create' get 'auth/:provider/callback', to: 'oauth/callbacks#create'