更新验证码url

pull/65/head
fengshuonan 2021-02-08 23:22:07 +08:00
parent 433a438171
commit a480802679
2 changed files with 17 additions and 17 deletions

View File

@ -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);

View File

@ -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>
</html>