Merge branch 'pre_trustie_server' into trustie_server

This commit is contained in:
yystopf 2024-08-12 15:04:58 +08:00
commit 65dba54a41
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,18 @@
class Oauth::AcgeController < Oauth::BaseController class Oauth::AcgeController < Oauth::BaseController
include RegisterHelper include RegisterHelper
def refer
uid = params['uid'].to_s.strip
tip_exception("uid不能为空") if uid.blank?
open_user = OpenUsers::Acge.find_by(uid: uid)
if open_user.present? && open_user.user.present?
render :json => {login: open_user.user.login}
else
render_not_found
end
end
def create def create
begin begin
uid = params['uid'].to_s.strip uid = params['uid'].to_s.strip

View File

@ -26,6 +26,7 @@ Rails.application.routes.draw do
get 'auth/failure', to: 'oauth/base#auth_failure' get 'auth/failure', to: 'oauth/base#auth_failure'
get 'auth/cas/callback', to: 'oauth/cas#create' get 'auth/cas/callback', to: 'oauth/cas#create'
get 'auth/acge/callback', to: "oauth/acge#create" get 'auth/acge/callback', to: "oauth/acge#create"
get 'auth/acge/refer', to: "oauth/acge#refer"
get 'auth/:provider/callback', to: 'oauth/callbacks#create' get 'auth/:provider/callback', to: 'oauth/callbacks#create'
get 'oauth/bind', to: 'oauth/educoder#bind' get 'oauth/bind', to: 'oauth/educoder#bind'