验证码
This commit is contained in:
@@ -13,6 +13,7 @@ layui.use([ 'carousel', 'form' ], function() {
|
||||
timestamp = (new Date()).valueOf();
|
||||
var type = system_config?.captchaType || "math"; // 默认 math
|
||||
var url = basePath + "/captcha/captchaImage?type=" + type + "×tamp=" + timestamp;
|
||||
console.log("点击验证码啦啦啦啦啦")
|
||||
$(".imgcode").attr("src", url);
|
||||
}
|
||||
|
||||
@@ -20,9 +21,14 @@ layui.use([ 'carousel', 'form' ], function() {
|
||||
refreshCaptcha(); // ✅ 页面加载手动刷新
|
||||
$('#telephone').focus();
|
||||
|
||||
// 点击验证码图片刷新
|
||||
$('.imgcode').off('click').on('click', refreshCaptcha); // ✅ 点击后刷新
|
||||
|
||||
// 事件委托 + 每次点击时都能绑定
|
||||
$(document).on('click', '.imgcode', function () {
|
||||
console.log('验证码点击了');
|
||||
var timestamp = Date.now();
|
||||
var type = system_config?.captchaType || "math";
|
||||
var url = basePath + "/captcha/captchaImage?type=" + type + "×tamp=" + timestamp;
|
||||
$(this).attr("src", url);
|
||||
});
|
||||
// 监听提交
|
||||
form.on('submit(login_)', function(data) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user