diff --git a/ksafepack-admin/src/main/resources/static/plat/js/login.js b/ksafepack-admin/src/main/resources/static/plat/js/login.js index 3521a0e..ef05a0a 100644 --- a/ksafepack-admin/src/main/resources/static/plat/js/login.js +++ b/ksafepack-admin/src/main/resources/static/plat/js/login.js @@ -11,21 +11,17 @@ layui.use([ 'carousel', 'form' ], function() { // 刷新验证码方法 function refreshCaptcha() { timestamp = (new Date()).valueOf(); - var type = system_config?.captchaType || "math"; // 默认 math,可根据配置变更 + var type = system_config?.captchaType || "math"; // 默认 math var url = basePath + "/captcha/captchaImage?type=" + type + "×tamp=" + timestamp; $(".imgcode").attr("src", url); } // 页面加载时刷新验证码 - $(function() { - refreshCaptcha(); - $('#telephone').focus(); - }); + refreshCaptcha(); // ✅ 页面加载手动刷新 + $('#telephone').focus(); - // 点击验证码图片刷新 - $('.imgcode').click(function () { - refreshCaptcha(); - }); +// 点击验证码图片刷新 + $('.imgcode').off('click').on('click', refreshCaptcha); // ✅ 点击后刷新 // 监听提交 form.on('submit(login_)', function(data) { @@ -132,8 +128,8 @@ layui.use([ 'carousel', 'form' ], function() { } }); - setTimeout(function () { + /*setTimeout(function () { $('.imgcode').click(); - }, 100); // 确保 DOM 渲染完成 + }, 100); // 确保 DOM 渲染完成*/ }); \ No newline at end of file diff --git a/ksafepack-admin/src/main/resources/templates/plat/login.ftl b/ksafepack-admin/src/main/resources/templates/plat/login.ftl index 367643d..b6af201 100644 --- a/ksafepack-admin/src/main/resources/templates/plat/login.ftl +++ b/ksafepack-admin/src/main/resources/templates/plat/login.ftl @@ -97,7 +97,7 @@ -->
/> + src="${base}/captcha/captchaImage?type=math×tamp=${.now?long}" />
diff --git a/ksafepack-common/src/main/java/com/kelp/common/base/RichFreeMarkerView.java b/ksafepack-common/src/main/java/com/kelp/common/base/RichFreeMarkerView.java index 581c202..7bd0690 100644 --- a/ksafepack-common/src/main/java/com/kelp/common/base/RichFreeMarkerView.java +++ b/ksafepack-common/src/main/java/com/kelp/common/base/RichFreeMarkerView.java @@ -12,8 +12,8 @@ public class RichFreeMarkerView extends FreeMarkerView { protected void exposeHelpers(Map model, HttpServletRequest request) throws Exception { -// String baseUrl = "http://aos.yyundong.com" + request.getContextPath(); - String baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); + String baseUrl = "http://aos.yyundong.com" + request.getContextPath(); +// String baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); model.put("contextPath", request.getContextPath()); model.put("base", baseUrl);