mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
修复: 合并从develop
This commit is contained in:
@@ -4,7 +4,7 @@ module RenderHelper
|
||||
end
|
||||
|
||||
def render_error(message = '')
|
||||
render json: { status: -1, message: message }
|
||||
render json: { status: status, message: message }
|
||||
end
|
||||
|
||||
def render_not_acceptable(message = '请求已拒绝')
|
||||
|
||||
@@ -302,6 +302,12 @@ class UsersController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def email_search
|
||||
return render_error('请输入email') if params[:email].blank?
|
||||
@user = User.find_by(mail: params[:email])
|
||||
return render_not_found unless @user.present?
|
||||
end
|
||||
|
||||
private
|
||||
def load_user
|
||||
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
||||
@@ -391,4 +397,4 @@ class UsersController < ApplicationController
|
||||
successful_authentication(user) if user.present?
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
1
app/views/users/email_search.json.jbuilder
Normal file
1
app/views/users/email_search.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! 'users/user', locals: { user: @user }
|
||||
@@ -248,6 +248,7 @@ Rails.application.routes.draw do
|
||||
get :trustie_projects
|
||||
get :trustie_related_projects
|
||||
post :sync_user_info
|
||||
get :email_search
|
||||
|
||||
scope '/ci', module: :ci do
|
||||
scope do
|
||||
|
||||
Reference in New Issue
Block a user