Skip to content

Commit

Permalink
更新:支持点击按钮时自动刷新验证码
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Jan 18, 2023
1 parent 6f2b8e7 commit a4f0bbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
14 changes: 4 additions & 10 deletions app/Plugins/Core/resources/assets/js/app.js
Expand Up @@ -4033,17 +4033,11 @@ $(function () {
position: "topRight"
});
});
});
}); // 点击按钮是自动刷新验证码

$(function () {
$('button[auto-event="disabled"]').on("click", function () {
var _this = this;

$(this).attr('disabled', 'disabled');
var timeout = $(this).attr('timeout');
setTimeout(function () {
$(_this).removeAttr('disabled');
}, timeout);
$(this).parents('form').submit();
$(":button").click(function () {
$('.captcha').attr('src', '/captcha?id=' + Math.random());
});
});

Expand Down
12 changes: 4 additions & 8 deletions app/Plugins/Core/resources/package/js/app.js
Expand Up @@ -199,14 +199,10 @@ $(function () {
})
})

$(function () {
$('button[auto-event="disabled"]').on("click", function () {
$(this).attr('disabled', 'disabled')
const timeout = $(this).attr('timeout')
setTimeout(() => {
$(this).removeAttr('disabled')
}, timeout)
$(this).parents('form').submit()
// 点击按钮是自动刷新验证码
$(function(){
$(":button").click(function(){
$('.captcha').attr('src','/captcha?id='+Math.random())
})
})

Expand Down
2 changes: 1 addition & 1 deletion public/mix-manifest.json
Expand Up @@ -10,7 +10,7 @@
"/js/admin/index.js": "/js/admin/index.js?id=505f34d21dc046de3d56",
"/js/admin/pay.js": "/js/admin/pay.js?id=476f7157fca67c342d8c",
"/plugins/User/js/order.js": "/plugins/User/js/order.js?id=75d4436e905e45647c23",
"/plugins/Core/js/app.js": "/plugins/Core/js/app.js?id=00e39d1f1fd2a1c0ff60",
"/plugins/Core/js/app.js": "/plugins/Core/js/app.js?id=1b39108431005472761a",
"/plugins/Topic/js/topic.js": "/plugins/Topic/js/topic.js?id=2441d18b977cde255036",
"/plugins/Topic/js/core.js": "/plugins/Topic/js/core.js?id=e708c7802a4023011c7a",
"/plugins/Comment/js/topic.js": "/plugins/Comment/js/topic.js?id=29dcafc461430b7a09ea",
Expand Down

0 comments on commit a4f0bbf

Please sign in to comment.