From fe8291d05c1d8b4535587d9f43afc9e11ac3daa4 Mon Sep 17 00:00:00 2001 From: printempw Date: Mon, 5 Sep 2016 22:27:35 +0800 Subject: [PATCH] enhance notice when submitted too many wrong passwords --- resources/assets/js/auth.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/auth.js b/resources/assets/js/auth.js index ac89353b..7b9cc677 100644 --- a/resources/assets/js/auth.js +++ b/resources/assets/js/auth.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-17 10:54:22 * @Last Modified by: printempw - * @Last Modified time: 2016-08-26 13:05:14 + * @Last Modified time: 2016-09-05 22:24:33 */ 'use strict'; @@ -69,18 +69,17 @@ $('#login-button').click(function() { } else { if (json.login_fails > 3) { - swal({ - type: 'error', - html: '你尝试的次数太多啦,请输入验证码' - }); + if ($('#captcha-form').css('display') == "none") { + swal({ + type: 'error', + html: '你尝试的次数太多啦,请输入验证码' + }); + } $('#captcha-form').show(); - freshCaptcha(); } - if ($('#captcha-form').css('display') == "block") { - freshCaptcha(); - } + freshCaptcha(); showMsg(json.msg, 'warning'); $('#login-button').html('登录').prop('disabled', '');