<script type="text/javascript">
layui.use(['layer', 'jquery'], function () {
var $ = layui.$;
layer = layui.layer;
$("#sendsubmi").click(function () {
var umail = $('#umail').val();
var passwordd = $('#passwordd').val();
var passworde = $('#passworde').val();
var passwordc = $('#passwordc').val();
$.ajax({
type: 'post',
url: '{% url 'forgetpass' %}', //发送请求
data: {csrfmiddlewaretoken: '{{ csrf_token }}', 'umail':umail, 'passwordd':passwordd, 'passworde':passworde, 'passwordc':passwordc},
dataType: 'json',
success: function (datad) {
if (datad.stat === "1"){
layer.msg(datad.mrg, {icon: 1, offset: "auto", time: 2000});
window.location = '{% url 'login' %}';
}
else {
layer.msg('修改密码失败,请确认你的信息', {icon: 2, offset: "auto", time: 2000});
}
},
error: function () {
layer.msg("发送失败,请确认你的信息!", {icon: 2, offset: "auto", time: 2000});
}
});
});
})
</script>