From a480802679268702c62491a42b1800ae812973a4 Mon Sep 17 00:00:00 2001 From: fengshuonan <sn93@qq.com> Date: Mon, 8 Feb 2021 23:22:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=AA=8C=E8=AF=81=E7=A0=81ur?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/pages/login.html | 2 +- src/main/webapp/pages/register.html | 32 ++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/pages/login.html b/src/main/webapp/pages/login.html index 4fe41bd5..c007a111 100644 --- a/src/main/webapp/pages/login.html +++ b/src/main/webapp/pages/login.html @@ -238,7 +238,7 @@ // 获取验证码 function getKaptcha(){ - var request = new HttpRequest(Feng.ctxPath + '/kaptcha'+ '?t=' + (new Date).getTime(), 'get'); + var request = new HttpRequest(Feng.ctxPath + '/captcha'+ '?t=' + (new Date).getTime(), 'get'); var result = request.start(); $("#verKey").val(result.data.verKey) $('img.login-captcha').attr('src', result.data.verImage); diff --git a/src/main/webapp/pages/register.html b/src/main/webapp/pages/register.html index a779821e..ce5bb2ef 100644 --- a/src/main/webapp/pages/register.html +++ b/src/main/webapp/pages/register.html @@ -261,29 +261,29 @@ <script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js"></script> <script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=318"></script> <script> - layui.use(['layer', 'form', 'formX', 'HttpRequest','notice','admin'], function () { + layui.use(['layer', 'form', 'formX', 'HttpRequest', 'notice', 'admin'], function () { var $ = layui.jquery; var layer = layui.layer; var form = layui.form; var HttpRequest = layui.HttpRequest; - var notice=layui.notice; + var notice = layui.notice; var admin = layui.admin; $('.login-wrapper').removeClass('layui-hide'); /* 表单提交 */ form.on('submit(registerSubmit)', function (formData) { - admin.btnLoading('#loginSubmit',"登录中"); + admin.btnLoading('#loginSubmit', "登录中"); var request = new HttpRequest(Feng.ctxPath + "/sms/validateMessage", 'post', function (data) { var reg = new HttpRequest(Feng.ctxPath + "/sysUser/register", 'post', function (data) { layer.msg('注册成功', {icon: 1, time: 1500}, function () { - location.href = Feng.ctxPath+'/'; + location.href = Feng.ctxPath + '/'; }); }, function (data) { //停止loading admin.btnLoading('#loginSubmit', false); notice.msg(data.message, {icon: 2}); }); - formData.field.account=formData.field.email; + formData.field.account = formData.field.email; reg.set(formData.field); reg.start(true); @@ -292,19 +292,18 @@ admin.btnLoading('#loginSubmit', false); notice.msg(data.message, {icon: 2}); }); - request.set("templateCode","SMS_187746216"); + request.set("templateCode", "SMS_187746216"); request.set(formData.field); request.start(true); return false; }); /* 获取验证码 */ - //var captchaUrl = Feng.ctxPath + '/kaptcha'; $('#btnGetCode').click(function () { var $btn = $(this); var $inputPhone = $('input[name="phone"]'); var phone = $inputPhone.val(); - if(!phone){ + if (!phone) { layer.tips('请输入手机号', $inputPhone, {tips: [1, '#ff4c4c']}); return; } @@ -348,13 +347,13 @@ layui.formX.startTimer($btn, 60); notice.msg('发送成功', {icon: 1}); layer.close(layIndex); - },function (data) { + }, function (data) { notice.msg(data.message, {icon: 2}); }); - request.set("templateCode","SMS_187746216"); - request.set("phone",phone); - request.set("verKey",$("#verKey").val()); - request.set("verCode",$("#verCode").val()); + request.set("templateCode", "SMS_187746216"); + request.set("phone", phone); + request.set("verKey", $("#verKey").val()); + request.set("verCode", $("#verCode").val()); request.start(true); layer.close(loadIndex); }); @@ -363,9 +362,10 @@ } }) }); + // 获取验证码 - function getKaptcha(){ - var request = new HttpRequest(Feng.ctxPath + '/kaptcha'+ '?t=' + (new Date).getTime(), 'get'); + function getKaptcha() { + var request = new HttpRequest(Feng.ctxPath + '/captcha' + '?t=' + (new Date).getTime(), 'get'); var result = request.start(); $("#verKey").val(result.data.verKey) $('.layer-get-code>.lay-code-group>img').attr('src', result.data.verImage); @@ -374,4 +374,4 @@ }); </script> </body> -</html> \ No newline at end of file +</html>