Update login.js

This commit is contained in:
Anyon 2022-04-14 10:31:10 +08:00
parent 9cfb9702b1
commit 0b51e430d0

View File

@ -17,14 +17,14 @@ $(function () {
window.$body = $('body'); window.$body = $('body');
/*! 后台加密登录处理 */ /*! 后台加密登录处理 */
$body.find('[data-login-form]').map(function (that) { $body.find('form[data-login-form]').each(function (idx, form) {
(that = this), require(["md5"], function (md5) { require(['md5'], function (md5) {
$("form").vali(function (data) { $(form).vali(function (data) {
data['password'] = md5.hash(md5.hash(data['password']) + data['uniqid']); data['password'] = md5.hash(md5.hash(data['password']) + data['uniqid']);
$.form.load(location.href, data, "post", function (ret) { $.form.load(location.href, data, "post", function (ret) {
if (parseInt(ret.code) !== 1) { if (parseInt(ret.code) !== 1) {
$(that).find('[data-captcha]').trigger('click'); $(form).find('[data-captcha]').trigger('click');
$(that).find('.verify.layui-hide').removeClass('layui-hide'); $(form).find('.verify.layui-hide').removeClass('layui-hide');
} }
}, null, null, 'false'); }, null, null, 'false');
}); });