From 504690d25154e67a7a24c6eb1d9a197af4ff8e81 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 21 Feb 2020 20:37:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=BB=91=E5=AE=9A=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E6=97=B6=E6=9C=AA=E6=A0=A1=E9=AA=8C=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bind_users_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/bind_users_controller.rb b/app/controllers/bind_users_controller.rb index 91b7c42fd..cbe0a8c13 100644 --- a/app/controllers/bind_users_controller.rb +++ b/app/controllers/bind_users_controller.rb @@ -8,7 +8,8 @@ class BindUsersController < ApplicationController tip_exception '系统错误' if session[:unionid].blank? bind_user = User.try_to_login(params[:username], params[:password]) - tip_exception '用户名或者密码错误' if bind_user.check_password?(params[:password].to_s) + return render_error('用户名或者密码错误') if bind_user.blank? + tip_exception '用户名或者密码错误' unless bind_user.check_password?(params[:password].to_s) tip_exception '该账号已被绑定,请更换其他账号进行绑定' if bind_user.bind_open_user?(params[:type].to_s) OpenUsers::Wechat.create!(user: bind_user, uid: session[:unionid])