修复: 邮箱搜索不需要return 404
This commit is contained in:
parent
8e8ec821f2
commit
e36c7a4b6a
|
@ -304,7 +304,6 @@ class UsersController < ApplicationController
|
|||
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
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
json.partial! 'users/user', locals: { user: @user }
|
||||
if @user.present?
|
||||
json.partial! 'users/user', locals: { user: @user }
|
||||
else
|
||||
json.null
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue