diff --git a/public/static/admin/js/login.js b/public/static/admin/js/login.js index b5a44ba..ad5e8b7 100644 --- a/public/static/admin/js/login.js +++ b/public/static/admin/js/login.js @@ -2,50 +2,48 @@ define(["easy-admin"], function (ea) { var Controller = { index: function () { - if (top.location !== self.location) { top.location = self.location; } - - if (backgroundUrl) { - $('.container').css('background', 'url(' + backgroundUrl + ') 0% 0% / cover no-repeat') - } - - $('.bind-password').on('click', function () { - if ($(this).hasClass('icon-5')) { - $(this).removeClass('icon-5'); - $("input[name='password']").attr('type', 'password'); - } else { - $(this).addClass('icon-5'); - $("input[name='password']").attr('type', 'text'); + $(function () { + if (backgroundUrl) { + $('.container').css('background', 'url(' + backgroundUrl + ') 0% 0% / cover no-repeat') } - }); + $('.bind-password').on('click', function () { + if ($(this).hasClass('icon-5')) { + $(this).removeClass('icon-5'); + $("input[name='password']").attr('type', 'password'); + } else { + $(this).addClass('icon-5'); + $("input[name='password']").attr('type', 'text'); + } + }); - $('.icon-nocheck').on('click', function () { - if ($(this).hasClass('icon-check')) { - $(this).removeClass('icon-check'); - } else { - $(this).addClass('icon-check'); - } - }); + $('.icon-nocheck').on('click', function () { + if ($(this).hasClass('icon-check')) { + $(this).removeClass('icon-check'); + } else { + $(this).addClass('icon-check'); + } + }); - $('.login-tip').on('click', function () { - $('.icon-nocheck').click(); - }); + $('.login-tip').on('click', function () { + $('.icon-nocheck').click(); + }); - ea.listen(function (data) { - data['keep_login'] = $('.icon-nocheck').hasClass('icon-check') ? 1 : 0; - return data; - }, function (res) { - ea.msg.success(res.msg, function () { - window.location = ea.url('index'); - }) - }, function (res) { - ea.msg.error(res.msg, function () { - $('#refreshCaptcha').trigger("click"); + ea.listen(function (data) { + data['keep_login'] = $('.icon-nocheck').hasClass('icon-check') ? 1 : 0; + return data; + }, function (res) { + ea.msg.success(res.msg, function () { + window.location = ea.url('index'); + }) + }, function (res) { + ea.msg.error(res.msg, function () { + $('#refreshCaptcha').trigger("click"); + }); }); }); - }, }; return Controller;