From 4130200b397b6a46e5b6e65a9ac85149bd003872 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 6 Nov 2019 15:49:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/accounts_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 71d54be8b..d93327d78 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -82,7 +82,11 @@ class AccountsController < ApplicationController password_ok = @user.check_password?(params[:password].to_s) unless password_ok - normal_status(-2, "你已经输错密码#{login_control.error_times+1}次,还剩余#{login_control.remain_times-1}次机会") + if login_control.remain_times-1 == 0 + normal_status(-2, "连续输错密码达到#{login_control.error_times+1}次,账号将被锁定") + else + normal_status(-2, "你已经输错密码#{login_control.error_times+1}次,还剩余#{login_control.remain_times-1}次机会") + end login_control.increment! return end